CN102566849B - Method and device for acquiring tree-form data drawing output positions and ERP (enterprise resource planning) system - Google Patents

Method and device for acquiring tree-form data drawing output positions and ERP (enterprise resource planning) system Download PDF

Info

Publication number
CN102566849B
CN102566849B CN201010582680.4A CN201010582680A CN102566849B CN 102566849 B CN102566849 B CN 102566849B CN 201010582680 A CN201010582680 A CN 201010582680A CN 102566849 B CN102566849 B CN 102566849B
Authority
CN
China
Prior art keywords
tree data
node
output area
data node
distance
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201010582680.4A
Other languages
Chinese (zh)
Other versions
CN102566849A (en
Inventor
乔昕明
李馥龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kingdee Software China Co Ltd
Original Assignee
Kingdee Software China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kingdee Software China Co Ltd filed Critical Kingdee Software China Co Ltd
Priority to CN201010582680.4A priority Critical patent/CN102566849B/en
Publication of CN102566849A publication Critical patent/CN102566849A/en
Application granted granted Critical
Publication of CN102566849B publication Critical patent/CN102566849B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

The invention is applicable to the technical field of computers, and provides a method and a device for acquiring tree-form data drawing output positions and an ERP (enterprise resource planning) system. The method includes: acquiring the width of each tree-form data node output area of tree-form data in coordinate calculation orders and interval information of adjacent node output areas to determine the abscissa of each tree-form data node output area; calculating moving direction and moving distance of tree-form data nodes in each layer and updating the abscissa of the moved tree-form data nodes; determining the ordinate of each tree-form data node output area after the tree-form data nodes are moved; and outputting coordination information containing the tree-form data and the tree-form data node output areas of the tree-form data. The method and the device for acquiring tree-form data drawing output positions solve the problem that center of gravity of existing outputted tree-form data are not centered integrally and insufficiently compact, and tree-form data drawn and outputted by the method and the device are centered integrally, better in visual effect and more humanized.

Description

Tree data is drawn outgoing position and is obtained and output intent, device and ERP system
Technical field
The invention belongs to field of computer technology, relate in particular to a kind of tree data drafting outgoing position and obtain and output intent, device and ERP system.
Background technology
Usually tree data is used the form that represents of the list that is similar to the window explorer indentation, or adopt naturally from top and under tree-shaped outward appearance, can show intuitively hierarchical relationship, comprise, gather the application scenarios such as relation.At present, while using the computer graphical interface to carry out the tree-shaped outward appearance of output display, be manually to be depicted as picture by instrument, write as the static Html page, or use the function of the insertion figure of similar Word to carry out the graphical interfaces output of tree data.Yet, in enterprise's application scenarios, as ERP system, data are unpredictable, need to dynamically complete by computer program graphic plotting and the output of tree data, use the tree data figure center of gravity of existing method output not placed in the middle, compact not, poor visual effect, hommization not.
Summary of the invention
The purpose of the embodiment of the present invention is to provide a kind of tree data to draw outgoing position and obtains and output intent, device and ERP system, be intended to solve the tree data figure center of gravity of exporting due to existing tree data not placed in the middle, compact not, cause drawing the tree data poor visual effect of output, not the problem of hommization.
The embodiment of the present invention is achieved in that a kind of tree data drafting outgoing position obtains and output intent, and described method comprises the steps:
By the postorder traversal in the coordinate computations, tree data is set, obtain each tree data node output area of tree data in the coordinate computations width and with the pitch information of brotgher of node output area, determine the horizontal ordinate of each tree data node output area;
Horizontal ordinate and width information thereof according to every one deck tree data node in described tree data, calculate moving direction and the displacement of every one deck tree data node, and move this layer and follow-up tree layer according to described moving direction and displacement, upgrade the horizontal ordinate of mobile rear tree data node;
After the movement that completes the tree data node, according to the height of tree data node output area in the every one deck of the tree data obtained and with the interlamellar spacing information of its father node output area, determine the ordinate of tree data node output area;
Output packet is containing the coordinate information of described tree data and tree data node output area thereof;
According to the coordinate information of described tree data and tree data node output area thereof, draw the described tree data of output;
Wherein, the described width that obtains each tree data node output area of tree data in the coordinate computations and with the pitch information of brotgher of node output area, determine that the step of the horizontal ordinate of each tree data node output area specifically comprises the steps:
Described tree data is carried out to postorder traversal, width according to tree data node output area, and with the pitch information of brotgher of node output area, determine the boundary set of described tree data node and the horizontal ordinate of output area, described boundary set comprises the border of described tree data node, and the border of the every one deck of described tree data descendant of node, the maximum capable of regulating amount of the forward that described border comprises described tree data node output area and the maximum capable of regulating amount of negative sense, and left margin and the right margin of described tree data node output area, described tree data node is the back end of accessing in the described tree data process of postorder traversal,
When there is the left brotgher of node in described tree data node, according to the boundary set of described tree data node and the boundary set of its left brotgher of node merging body, the subtree that the described tree data node of take is root node and the subtree that its left brotgher of node is root node of take are merged, and upgrade the horizontal ordinate of tree data node after merging.
Another purpose of the embodiment of the present invention is to provide a kind of tree data to draw outgoing position and obtains and output unit, and described device comprises:
The horizontal ordinate determining unit, be used for by the postorder traversal that coordinate computations tree data is set, obtain each tree data node output area of tree data in the coordinate computations width and with the pitch information of brotgher of node output area, determine the horizontal ordinate of each tree data node output area;
The node motion unit, for the every one deck tree data of tree data node horizontal ordinate and the width information thereof of obtaining according to the horizontal ordinate determining unit, calculate moving direction and the displacement of every one deck tree data node, and move this layer and follow-up tree layer according to described moving direction and displacement, upgrade the horizontal ordinate of mobile rear tree data node;
The ordinate determining unit, for after the movement that completes the tree data node, according to the height of tree data node output area in the every one deck of the tree data obtained and with the interlamellar spacing information of its father node output area, determine the ordinate of tree data node output area; And
The coordinate information output unit, the coordinate information for output packet containing tree data and tree data node output area thereof;
According to the coordinate information of described tree data and tree data node output area thereof, draw the unit of the described tree data of output;
Wherein, the horizontal ordinate determining unit comprises:
Horizontal ordinate is determined subelement, for described tree data is carried out to postorder traversal, width according to tree data node output area, and with the pitch information of brotgher of node output area, determine the boundary set of described tree data node and the horizontal ordinate of output area, described boundary set comprises the border of described tree data node, and the border of the every one deck of described tree data descendant of node, the maximum capable of regulating amount of the forward that described border comprises described tree data node output area and the maximum capable of regulating amount of negative sense, and left margin and the right margin of described tree data node output area, described tree data node is the back end of accessing in the described tree data process of postorder traversal, and
The node merge cells, for when there is the left brotgher of node in the tree data node, according to the boundary set of described tree data node and the boundary set of its left brotgher of node merging body, the subtree that the described tree data node of take is root node and the subtree that its left brotgher of node is root node of take are merged, upgrade the horizontal ordinate of tree data node after merging, described tree data node is the back end of accessing in the described tree data process of postorder traversal.
Another purpose of the embodiment of the present invention is to provide a kind of ERP system, and described system comprises tree data drafting outgoing position deriving means, and described device comprises:
The horizontal ordinate determining unit, be used for by the postorder traversal that coordinate computations tree data is set, obtain each tree data node output area of tree data in the coordinate computations width and with the pitch information of brotgher of node output area, determine the horizontal ordinate of each tree data node output area;
The node motion unit, for the every one deck tree data of tree data node horizontal ordinate and the width information thereof of obtaining according to the horizontal ordinate determining unit, calculate moving direction and the displacement of every one deck tree data node, and move this layer and follow-up tree layer according to described moving direction and displacement, upgrade the horizontal ordinate of mobile rear tree data node;
The ordinate determining unit, for after the movement that completes the tree data node, according to the height of tree data node output area in the every one deck of the tree data obtained and with the interlamellar spacing information of its father node output area, determine the ordinate of tree data node output area; And
The coordinate information output unit, the coordinate information for output packet containing tree data and tree data node output area thereof;
According to the coordinate information of described tree data and tree data node output area thereof, draw the unit of the described tree data of output;
Wherein, the horizontal ordinate determining unit comprises:
Horizontal ordinate is determined subelement, for described tree data is carried out to postorder traversal, width according to tree data node output area, and with the pitch information of brotgher of node output area, determine the boundary set of described tree data node and the horizontal ordinate of output area, described boundary set comprises the border of described tree data node, and the border of the every one deck of described tree data descendant of node, the maximum capable of regulating amount of the forward that described border comprises described tree data node output area and the maximum capable of regulating amount of negative sense, and left margin and the right margin of described tree data node output area, described tree data node is the back end of accessing in the described tree data process of postorder traversal, and
The node merge cells, for when there is the left brotgher of node in the tree data node, according to the boundary set of described tree data node and the boundary set of its left brotgher of node merging body, the subtree that the described tree data node of take is root node and the subtree that its left brotgher of node is root node of take are merged, upgrade the horizontal ordinate of tree data node after merging, described tree data node is the back end of accessing in the described tree data process of postorder traversal.
The embodiment of the present invention is by the width of tree data node output area, and with the pitch information of brotgher of node output area, determine the horizontal ordinate of each tree data node output area, and then obtain moving direction and the displacement of every layer of tree data, the tree layer is moved to adjustment, afterwards according to the height of tree data node output area and with the interlamellar spacing information of its father node output area, determine the ordinate of tree data node output area, the whole center of gravity of tree data that has overcome existing tree data output is not placed in the middle, compact not problem, make the tree data of drawing output whole placed in the middle, visual effect is better, hommization more.
The accompanying drawing explanation
Fig. 1 is the realization flow figure that the tree data that provides of first embodiment of the invention is drawn the outgoing position acquisition methods;
Fig. 2 a, Fig. 2 b, Fig. 2 c and Fig. 2 d are the instantiation figure that the tree data that provides of second embodiment of the invention is drawn the outgoing position acquisition methods;
Fig. 3 is the structural drawing that the tree data that provides of third embodiment of the invention is drawn the outgoing position deriving means.
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
The embodiment of the present invention is by the width of tree data node output area, and with the pitch information of brotgher of node output area, determine the horizontal ordinate of each tree data node output area, and then obtain moving direction and the displacement of every layer of tree data, the tree layer is moved to adjustment, afterwards according to the height of tree data node output area and with the interlamellar spacing information of its father node output area, determine the ordinate of tree data node output area, the whole center of gravity of tree data that has overcome existing tree data output is not placed in the middle, compact not problem, make the tree data of drawing output whole placed in the middle, visual effect is better, hommization more.
The embodiment of the present invention provides a kind of tree data to draw the outgoing position acquisition methods, and described method comprises the steps:
Obtain each tree data node output area of tree data in the coordinate computations width and with the pitch information of brotgher of node output area, determine the horizontal ordinate of each tree data node output area;
Horizontal ordinate and width information thereof according to every one deck tree data node in described tree data, calculate moving direction and the displacement of every one deck tree data node, and move this layer and follow-up tree layer according to described moving direction and displacement, upgrade the horizontal ordinate of mobile rear tree data node;
After the movement that completes the tree data node, according to the height of tree data node output area in the every one deck of the tree data obtained and with the interlamellar spacing information of its father node output area, determine the ordinate of tree data node output area;
Output packet is containing the coordinate information of described tree data and tree data node output area thereof.
The embodiment of the present invention also provides a kind of tree data to draw the outgoing position deriving means, and described device comprises:
The horizontal ordinate determining unit, for the width that obtains each tree data node output area of coordinate computations tree data and with the pitch information of brotgher of node output area, determine the horizontal ordinate of each tree data node output area;
The node motion unit, for the every one deck tree data of tree data node horizontal ordinate and the width information thereof of obtaining according to the horizontal ordinate determining unit, calculate moving direction and the displacement of every one deck tree data node, and move this layer and follow-up tree layer according to described moving direction and displacement, upgrade the horizontal ordinate of mobile rear tree data node;
The ordinate determining unit, for after the movement that completes the tree data node, according to the height of tree data node output area in the every one deck of the tree data obtained and with the interlamellar spacing information of its father node output area, determine the ordinate of tree data node output area; And
The coordinate information output unit, the coordinate information for output packet containing tree data and tree data node output area thereof.
The embodiment of the present invention also provides a kind of ERP system, and described system comprises tree data drafting outgoing position deriving means, and described device comprises:
The horizontal ordinate determining unit, for the width that obtains each tree data node output area of coordinate computations tree data and with the pitch information of brotgher of node output area, determine the horizontal ordinate of each tree data node output area;
The node motion unit, for the every one deck tree data of tree data node horizontal ordinate and the width information thereof of obtaining according to the horizontal ordinate determining unit, calculate moving direction and the displacement of every one deck tree data node, and move this layer and follow-up tree layer according to described moving direction and displacement, upgrade the horizontal ordinate of mobile rear tree data node;
The ordinate determining unit, for after the movement that completes the tree data node, according to the height of tree data node output area in the every one deck of the tree data obtained and with the interlamellar spacing information of its father node output area, determine the ordinate of tree data node output area; And
The coordinate information output unit, the coordinate information for output packet containing tree data and tree data node output area thereof.
The embodiment of the present invention is by the width of tree data node output area, and with the pitch information of brotgher of node output area, determine the horizontal ordinate of each tree data node output area, and then obtain moving direction and the displacement of every layer of tree data, the tree layer is moved to adjustment, afterwards according to the height of tree data node output area and with the interlamellar spacing information of its father node output area, determine the ordinate of tree data node output area, the whole center of gravity of tree data that has overcome existing tree data output is not placed in the middle, compact not problem, make the tree data of drawing output whole placed in the middle, visual effect is better, hommization more.
Below in conjunction with specific embodiment, specific implementation of the present invention is described in detail:
embodiment mono-:
The tree data that Fig. 1 shows first embodiment of the invention to be provided is drawn the realization flow of outgoing position acquisition methods, and details are as follows:
In step S101, obtain each tree data node output area of tree data in the coordinate computations width and with the pitch information of brotgher of node output area, determine the horizontal ordinate of each tree data node output area.
In embodiments of the present invention, obtain each tree data node output area of tree data in the coordinate computations width and with the pitch information of brotgher of node output area, determine that the horizontal ordinate of each tree data node output area specifically comprises two steps:
(1) to postorder traversal that in the coordinate computations, tree data is set, in the postorder traversal process, the data node is conducted interviews, obtain the width of this tree data node output area, and with the pitch information of brotgher of node output area, and then the horizontal ordinate of the boundary set of definite tree data node and output area, boundary set comprises the border of tree data node, and the border of the every one deck of tree data descendant of node, the maximum capable of regulating amount of the forward that border comprises tree data node output area and the maximum capable of regulating amount of negative sense, and left margin and the right margin of tree data node output area.
In embodiments of the present invention, in the postorder traversal process, when the tree data node is leaf node, boundary set only comprises the border of tree data node self, wherein the positive and negative of tree data node output area is 0 to maximum capable of regulating amount, and the left margin of tree data node output area is 0, and right margin is k, the width that k is tree data node output area, the initialization horizontal ordinate of tree data node output area is 0.
When the tree data node is not leaf node, determine the boundary set of tree data node, the boundary set of tree data node comprises the border of tree data node, and the border of every one deck of tree data descendant of node, wherein the maximum capable of regulating amount of the forward in the border of tree data node is 0, the maximum capable of regulating amount of negative sense is 0, if the width of tree data node output area is k, the left margin of the ground floor of tree data descendant of node is l, right margin is r, the width of the ground floor output area that (r-l) is the tree data descendant of node, the horizontal ordinate of tree data node output area is l+ (r-l)/2-k/2, the left margin of tree data node output area is l+ (r-l)/2-k/2, right margin is l+ (r-l)/2+k/2.
(2) when there is the left brotgher of node in the tree data node, according to the boundary set of tree data node and the boundary set of its left brotgher of node merging body, the subtree that the tree data node of take is root node and the subtree that its left brotgher of node is root node of take are merged, and upgrade the horizontal ordinate of tree data node after merging.
In embodiments of the present invention, when there is the left brotgher of node in the tree data node, the tree data node need to be merged to its left brotgher of node place merges in body, in concrete embodiment, can fix and take the subtree that this tree data node is root node, or fixing take the subtree that its left brotgher of node is root node, according to preset moving direction, loose subtree is carried out to translation, the maximal value that mobile distance is every one deck output area left margin and the right dividing value in fixing subtree, after translation, upgrade the horizontal ordinate of the tree data node of translation.
In concrete implementation process, upgrade after tree data node and its left brotgher of node merge the border that merges body, 1/2nd of the distance that the maximum capable of regulating amount of the forward of this mergings body and the maximum capable of regulating amount of negative sense are tree-like node output area median vertical line first tree data node output area median vertical line of arriving this merging body another side end;
At the tree data node, merge in its brotgher of node merging body process, every one deck of offspring that the every one deck of this tree data descendant of node brotgher of node left with it place merges body also merges.In the process of determining after tree data node and its left brotgher of node merge the border that merges the body offspring, the maximum capable of regulating amount of the every one deck forward of merging body offspring after tree data node and its left brotgher of node merge is min (p1, p2), wherein P1 is the maximum capable of regulating amount of forward in this layer of border of tree data node, P2 is the maximum capable of regulating amount of the forward in its this layer of border of left brotgher of node, merging the maximum capable of regulating amount of the every one deck negative sense of body offspring after tree data node and its left brotgher of node merge is min (n1, n2), wherein n1 is the maximum capable of regulating amount of negative sense in this layer of border of tree data node, the minimum value that n2 is the maximum capable of regulating amount of negative sense in its this layer of border of left brotgher of node, when this layer only exists tree data node or its one of them border of left brotgher of node, just, negative movable distance be this border just, the maximum capable of regulating amount of negative sense, upgrade after tree data node and its left brotgher of node merge the boundary set that merges body.
In concrete implementation process, can according to the kind of data in the tree data node or its width that obtains its output area for No. ID and with the pitch information of brotgher of node output area, for example, the width of the node output area of same division data is identical, the width of the output area of different division datas is all different, thereby the data to different departments are distinguished, these information can be stored with the form of configuration file or database table in advance.
In step S102, horizontal ordinate and width information thereof according to every one deck tree data node in tree data, calculate moving direction and the displacement of every one deck tree data node, and move this layer and follow-up tree layer according to moving direction and displacement, upgrade the horizontal ordinate of mobile rear tree data node.
In embodiments of the present invention, after the postorder traversal completed tree data, the border of tree data root node and the maximum capable of regulating amount of left margin, right margin, forward and the maximum capable of regulating amount of negative sense of its each layer of offspring have been preserved in tree data root node boundary set, the maximum capable of regulating amount of the forward of tree data root node and the maximum capable of regulating amount of negative sense are all 0, do not need mobile.When calculating the displacement of the every one deck of tree data root node offspring, left margin in the calculating every one deck of tree data root node border and the distance of tree data root node output area vertical center line, be designated as the left margin distance, and the distance of the right margin in the every one deck of tree data root node border and tree data root node output area vertical center line, be designated as the right margin distance, calculate left, / 2nd of a difference absolute value of right margin distance, be designated as and wish to adjust distance, especially, when the left margin of this layer and right margin are positioned at the left side of tree data root node output area vertical center line, the right margin distance is 0, when the left margin of this layer and right margin are positioned at the right side of tree data root node output area vertical center line, the left margin linear distance is 0,
When the left margin linear distance be greater than right margin apart from the time, the distance of translation is for wishing to adjust the minimum value apart from the maximum capable of regulating amount of the forward with this layer, by this layer and succeeding layer to right translation, according to the distance of translation and the horizontal ordinate that upgrades the tree data node, when right margin distance be less than right margin apart from the time, by this layer and succeeding layer to left, the distance of translation is for wishing to adjust the minimum value apart from the maximum capable of regulating amount of the negative sense with this layer, the horizontal ordinate that upgrades the tree data node according to distance and the direction of translation.
After the adjustment completed the every one deck of tree data root node offspring, whole tree output area leftmost position, border may become negative or positive number by original 0, and negative meaning partial content will be lost, and positive number is meaned has wasted the space of the blank in the left side.Now need the outgoing position of all nodes is once repaired the integral translation of character, all tree data nodes in tree data are carried out to translation, the horizontal ordinate that makes leftmost tree graphic data node in tree data is 0.Can certainly by external entity when drawing output, add a reparation amount, to reduce the level traversal one time.
In step S103, after the movement that completes the tree data node, according to the height of tree data node output area in the every one deck of the tree data obtained and with the interlamellar spacing information of its father node output area, determine the ordinate of tree data node output area.
In embodiments of the present invention, the preorder traversal of the breadth First that tree data is set, according to the height of tree data node output area in the every one deck of tree data and with the interlamellar spacing of its father node output area, obtain the height of the every one deck output area of tree data, determine the ordinate of tree data node output area.In concrete implementation process, can take the data structure of queue to realize the preorder traversal to the breadth First of tree data, through traversal, determined the height of every layer of output area, thereby added up and obtain the ordinate of all tree data nodes by the height of every layer.
In step S104, output packet is containing the coordinate information of tree data and tree data node output area thereof.
In embodiments of the present invention, by for the tree data node, adding boundary set, wherein boundary set has comprised the movable distance of tree data node output area, in the postorder traversal process of the depth-first of tree data, back end is merged in the merging body at the tree data node place of having accessed, determine the moving direction of the every one deck of tree data root node offspring, and then boundary set and the horizontal ordinate of renewal tree data node, finally by the preorder traversal that tree data is set, further determine the ordinate of tree data node, make the tree data of drawing output whole placed in the middle, compacter, visual effect is better.
One of ordinary skill in the art will appreciate that all or part of step realized in above-described embodiment method is to come the hardware that instruction is relevant to complete by program, described program can be stored in a computer read/write memory medium, described storage medium, as ROM/RAM, disk, CD etc.
embodiment bis-:
According to embodiment mono-, two, the tree data that Fig. 2 a, Fig. 2 b, Fig. 2 c, Fig. 2 d show second embodiment of the invention to be provided is drawn the instantiation of outgoing position acquisition methods, and details are as follows:
Fig. 2 a, Fig. 2 b have described the process that Node B merges to its brotgher of node A, in embodiments of the present invention, in order to be illustrated more clearly in this process, the width of supposing each node is all 100, spacing between the brotgher of node is 0, adopts the mode moved to right to realize the merging of node.
Fig. 2 a has described Node B and has joined its left brotgher of node A position relationship of node before, and now, the boundary set of node A, B and horizontal ordinate are as shown in table 1 the 2nd row, and wherein the boundary set of node A comprises the border of node A, and the border of its each layer of offspring.The first floor border of node A is [50,150], (0,0), 50 left margins that are node A wherein, 150 right margins that are node A, the forward displacement of node A and negative sense displacement are all 0, node A offspring's ground floor border is [0,200], (50,50), node A offspring's second layer border is [50,250], (50,50), the horizontal ordinate of node A is 50, and the border of Node B is [0,100], the horizontal ordinate of output area is 0, and now node A, B not yet merge.
Fig. 2 b has described the position relationship that Node B joins its left brotgher of node A posterior nodal point, and now, the boundary set of node A, B and horizontal ordinate are as shown in table 1 the 3rd row, and boundary set and the horizontal ordinate of node A are constant.Node B is leaf node, and its boundary set only includes itself border, and after merging, the left and right border on the border of Node B is [150,250], it is positive and negative no longer upgrades to maximum capable of regulating amount, and producing a boundary set that merges body AB after node A, B merge is { [50,250], (50,50), [0,200], (50,50), [50, 250], (50, 50) }, the ground floor that merges body AB boundary set is node A and Ceng border, Node B place, wherein the maximum capable of regulating amount of the maximum capable of regulating amount of forward and negative sense is node A median vertical line to 1/2nd of the distance of Node B median vertical line, for (50, 50), the border that merges body AB offspring also merges, because only existing, the ground floor that merges body AB offspring take the subtree that node A is root node, so, after merging, the offspring's of merging body AB ground floor just, the maximum capable of regulating amount of negative sense be in node A offspring's ground floor border just, the maximum capable of regulating amount of negative sense, (50, 50), in like manner, just be combined the body AB offspring second layer, the maximum capable of regulating amount of negative sense is (50, 50).
Table 1:
Figure GDA0000394591770000121
Fig. 2 c shows take the process that subtree that node C is root node and the subtree that its left brotgher of node is root node of take merge, and Fig. 2 d has described take subtree that node C is root node and the subtree that its left brotgher of node is root node of the take position relationship after merging.In embodiments of the present invention, because node C is not leaf node, the initialization boundary set of node C has comprised himself border [100,200], (0,0), and the border [0,300] that is merged bodies by its three child nodes, (100,100), the horizontal ordinate of node C is 100, as shown in table 2 the 2nd row.When node C being detected and have the left brotgher of node, attempt being merged with the merging body of AB, during merging, should consider node C and its child node all can not with the merging body of AB in any node stack, border that now can be by each node layer of subtree of relatively merging is to determine the distance moved to right, in embodiments of the present invention, the boundary set of merging body AB is { [50,250], (50,50); [0,200], (50,50); [50,250], (50,50) } and the boundary set of node C be respectively { [100,200], (0,0); [0,300], (100,100) }, by relatively merging the left and right border of body AB and node C respective layer, can obtain egress C and need to move to right and 150 just can not superpose with AB, and the child node of node C need to move to right 200 just not can with the ground floor child node stack that merges body AB offspring, therefore the subtree that the node C of take is root node need to move to right and 200 just can complete merging, and the node correlation attribute value of the tree after merging is as shown in table 2 the 3rd row.After merging, the horizontal ordinate of C is: 300.Each layer of merging body ABC after calculate merging positive and negative is during to maximum capable of regulating amount, the first floor that merges body ABC for the median vertical line that merges the left sibling output area of body ABC to 1/2nd of the distance of the median vertical line of rightmost node output area, namely the median vertical line of node A output area, to 1/2nd of the distance of the median vertical line of node C output area, is 125.The positive and negative of the second layer is the second layer border positive and negative minimum value to maximum capable of regulating amount corresponding to the second layer border of node C that merges body AB to displacement, and the maximum capable of regulating amount of forward is 50, and the maximum capable of regulating amount of negative sense is 50.Have three layers because merge the boundary set of body AB, and that the boundary set of node C only has is two-layer, therefore, the 3rd layer positive and negative to maximum capable of regulating amount, for merging the positive and negative to maximum capable of regulating amount of the 3rd layer of body AB, is (50,50).
Table 2:
Figure GDA0000394591770000131
Figure GDA0000394591770000141
embodiment tri-:
The tree data that Fig. 3 shows third embodiment of the invention to be provided is drawn the structure that outgoing position obtains, and for convenience of explanation, only shows the part relevant to the embodiment of the present invention.
This tree data outgoing position deriving means can be for ERP system, perhaps there is figure outgoing position, tree data and draw the application system that outgoing position obtains function, for example, in drafting system, can be the software unit that runs on these systems, also can be used as independently suspension member and be integrated in these systems, this tree data be drawn the outgoing position deriving means and is comprised: horizontal ordinate determining unit 31, node motion unit 32, ordinate determining unit 33, coordinate information output unit 34, wherein:
Horizontal ordinate determining unit 31 obtain each tree data node output area of tree data in the coordinate computations width and with the pitch information of brotgher of node output area, determine the horizontal ordinate of each tree data node output area.Horizontal ordinate determining unit 31 specifically comprises that horizontal ordinate determines subelement 311 and node merge cells 312, wherein:
Horizontal ordinate determines that 311 pairs of tree datas of subelement carry out postorder traversal, width according to tree data node output area, and with the pitch information of brotgher of node output area, determine the boundary set of tree data node and the horizontal ordinate of output area, boundary set comprises the border of tree data node, and the border of the every one deck of tree data descendant of node, the maximum capable of regulating amount of the forward that border comprises tree data node output area and the maximum capable of regulating amount of negative sense, and left margin and the right margin of tree data node output area, the tree data node is the back end of accessing in postorder traversal tree data process.
When there is the left brotgher of node in the tree data node, node merge cells 312 is according to the boundary set of tree data node and the boundary set of its left brotgher of node merging body, the subtree that the tree data node of take is root node and the subtree that its left brotgher of node is root node of take are merged, upgrade the horizontal ordinate of tree data node after merging, this tree data node is the back end of accessing in postorder traversal tree data process.
Every one deck tree data node horizontal ordinate and width information thereof in the tree data that node motion unit 32 obtains according to horizontal ordinate determining unit 31, calculate moving direction and the displacement of every one deck tree data node, and move this layer and follow-up tree layer according to moving direction and displacement, upgrade the horizontal ordinate of mobile rear tree data node.Node motion unit 32 specifically comprises displacement computing unit 321 and node translation unit 322, wherein:
After the postorder traversal completed tree data, displacement computing unit 321 is according to the every one deck output area of the tree data root node offspring border of preserving in tree data root node boundary set, calculate the left margin distance of the every one deck of tree data root node offspring, distance is adjusted in right margin distance and hope, left margin distance is left margin in the every one deck of tree data root node offspring border and the distance of tree data root node output area vertical center line, right margin distance is right margin in this layer of border and the distance of tree data root node output area vertical center line, wishing to adjust distance is that this layer of left margin is apart from 1/2nd of the difference absolute value with this layer of right margin distance.
When left margin distance be greater than right margin apart from the time, node translation unit 322 by this layer and succeeding layer to right translation, the distance of translation is for wishing to adjust the minimum value apart from the maximum capable of regulating amount of the forward with this layer, the horizontal ordinate that upgrades the tree data node according to distance and the direction of translation, when left margin distance be less than right margin apart from the time, by this layer and succeeding layer to left, the distance of translation is for wishing to adjust the minimum value apart from the maximum capable of regulating amount of the negative sense with this layer, the horizontal ordinate that upgrades the tree data node according to distance and the direction of translation.
After the movement that completes the tree data node, ordinate determining unit 33 according to the height of tree data node output area in the every one decks of tree data that obtain and with the interlamellar spacing information of its father node output area, determine the ordinate of tree data node output area; Coordinate information output unit 34 output packets are containing the coordinate information of tree data and tree data node output area thereof.
Above are only system embodiment of the present invention, the function of its each unit, as described in above-mentioned embodiment of the method, does not repeat them here, but not in order to limit the present invention.
The embodiment of the present invention is by the width of tree data node output area, and with the pitch information of brotgher of node output area, determine the horizontal ordinate of each tree data node output area, and then obtain moving direction and the displacement of every layer of tree data, the tree layer is moved to adjustment, afterwards according to the height of tree data node output area and with the interlamellar spacing information of its father node output area, determine the ordinate of tree data node output area, the whole center of gravity of tree data that has overcome existing tree data output is not placed in the middle, compact not problem, make the tree data of drawing output whole placed in the middle, visual effect is better, hommization more.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any modifications of doing within the spirit and principles in the present invention, be equal to and replace and improvement etc., within all should being included in protection scope of the present invention.

Claims (5)

1. a tree data drafting outgoing position obtains and output intent, it is characterized in that, described method comprises the steps:
By the postorder traversal in the coordinate computations, tree data is set, obtain each tree data node output area of tree data in the coordinate computations width and with the pitch information of brotgher of node output area, determine the horizontal ordinate of each tree data node output area;
Horizontal ordinate and width information thereof according to every one deck tree data node in described tree data, calculate moving direction and the displacement of every one deck tree data node, and move this layer and follow-up tree layer according to described moving direction and displacement, upgrade the horizontal ordinate of mobile rear tree data node;
After the movement that completes the tree data node, according to the height of tree data node output area in the every one deck of the tree data obtained and with the interlamellar spacing information of its father node output area, determine the ordinate of tree data node output area;
Output packet is containing the coordinate information of described tree data and tree data node output area thereof;
According to the coordinate information of described tree data and tree data node output area thereof, draw the described tree data of output;
Wherein, the described width that obtains each tree data node output area of tree data in the coordinate computations and with the pitch information of brotgher of node output area, determine that the step of the horizontal ordinate of each tree data node output area specifically comprises the steps:
Described tree data is carried out to postorder traversal, width according to tree data node output area, and with the pitch information of brotgher of node output area, determine the boundary set of described tree data node and the horizontal ordinate of output area, described boundary set comprises the border of described tree data node, and the border of the every one deck of described tree data descendant of node, the maximum capable of regulating amount of the forward that described border comprises described tree data node output area and the maximum capable of regulating amount of negative sense, and left margin and the right margin of described tree data node output area, described tree data node is the back end of accessing in the described tree data process of postorder traversal,
When there is the left brotgher of node in described tree data node, according to the boundary set of described tree data node and the boundary set of its left brotgher of node merging body, the subtree that the described tree data node of take is root node and the subtree that its left brotgher of node is root node of take are merged, and upgrade the horizontal ordinate of tree data node after merging.
2. the method for claim 1, it is characterized in that, described horizontal ordinate and width information thereof according to every one deck tree data node in described tree data, calculate moving direction and the displacement of every one deck tree data node, and move this layer and follow-up tree layer according to described moving direction and displacement, the step of upgrading the horizontal ordinate of mobile rear tree data node specifically comprises:
After the postorder traversal completed described tree data, according to the every one deck output area of the described tree data root node offspring border of preserving in tree data root node boundary set, calculate the left margin distance of the every one deck of described tree data root node offspring, distance is adjusted in right margin distance and hope, described left margin distance is left margin in the every one deck of described tree data root node offspring border and the distance of described tree data root node output area vertical center line, described right margin distance is right margin in this layer of border and the distance of described tree data root node output area vertical center line, it is that this layer of left margin is apart from 1/2nd of the difference absolute value with this layer of right margin distance that distance is adjusted in described hope,
When left margin distance be greater than right margin apart from the time, by this layer and succeeding layer to right translation, the distance of translation is for wishing to adjust the minimum value apart from the maximum capable of regulating amount of the forward with this layer, the horizontal ordinate that upgrades the tree data node according to distance and the direction of translation, when left margin distance be less than right margin apart from the time, by this layer and succeeding layer to left, the distance of translation is for wishing to adjust the minimum value apart from the maximum capable of regulating amount of the negative sense with this layer, the horizontal ordinate that upgrades the tree data node according to distance and the direction of translation.
3. a tree data drafting outgoing position obtains and output unit, it is characterized in that, described device comprises:
The horizontal ordinate determining unit, be used for by the postorder traversal that coordinate computations tree data is set, obtain each tree data node output area of tree data in the coordinate computations width and with the pitch information of brotgher of node output area, determine the horizontal ordinate of each tree data node output area;
The node motion unit, for the every one deck tree data of tree data node horizontal ordinate and the width information thereof of obtaining according to the horizontal ordinate determining unit, calculate moving direction and the displacement of every one deck tree data node, and move this layer and follow-up tree layer according to described moving direction and displacement, upgrade the horizontal ordinate of mobile rear tree data node;
The ordinate determining unit, for after the movement that completes the tree data node, according to the height of tree data node output area in the every one deck of the tree data obtained and with the interlamellar spacing information of its father node output area, determine the ordinate of tree data node output area; And
The coordinate information output unit, the coordinate information for output packet containing tree data and tree data node output area thereof;
According to the coordinate information of described tree data and tree data node output area thereof, draw the unit of the described tree data of output;
Wherein, the horizontal ordinate determining unit comprises:
Horizontal ordinate is determined subelement, for described tree data is carried out to postorder traversal, width according to tree data node output area, and with the pitch information of brotgher of node output area, determine the boundary set of described tree data node and the horizontal ordinate of output area, described boundary set comprises the border of described tree data node, and the border of the every one deck of described tree data descendant of node, the maximum capable of regulating amount of the forward that described border comprises described tree data node output area and the maximum capable of regulating amount of negative sense, and left margin and the right margin of described tree data node output area, described tree data node is the back end of accessing in the described tree data process of postorder traversal, and
The node merge cells, for when there is the left brotgher of node in the tree data node, according to the boundary set of described tree data node and the boundary set of its left brotgher of node merging body, the subtree that the described tree data node of take is root node and the subtree that its left brotgher of node is root node of take are merged, upgrade the horizontal ordinate of tree data node after merging, described tree data node is the back end of accessing in the described tree data process of postorder traversal.
4. device as claimed in claim 3, is characterized in that, described node motion unit specifically comprises:
The displacement computing unit, for after the postorder traversal completed described tree data, according to the every one deck output area of the described tree data root node offspring border of preserving in tree data root node boundary set, calculate the left margin distance of the every one deck of described tree data root node offspring, distance is adjusted in right margin distance and hope, described left margin distance is left margin in the every one deck of described tree data root node offspring border and the distance of described tree data root node output area vertical center line, described right margin distance is right margin in this layer of border and the distance of described tree data root node output area vertical center line, it is that this layer of left margin is apart from 1/2nd of the difference absolute value with this layer of right margin distance that distance is adjusted in described hope, and
The node translation unit, for when left margin apart from be greater than right margin apart from the time, by this layer and succeeding layer to right translation, the distance of translation is for wishing to adjust the minimum value apart from the maximum capable of regulating amount of the forward with this layer, the horizontal ordinate that upgrades the tree data node according to distance and the direction of translation, when left margin distance be less than right margin apart from the time, by this layer and succeeding layer to left, the distance of translation is for wishing to adjust the minimum value apart from the maximum capable of regulating amount of the negative sense with this layer, the horizontal ordinate that upgrades the tree data node according to distance and the direction of translation.
5. a tree data drafting outgoing position obtains and output system, it is characterized in that, comprises that the described tree data drafting of claim 3 or 4 outgoing position obtains and output unit.
CN201010582680.4A 2010-12-10 2010-12-10 Method and device for acquiring tree-form data drawing output positions and ERP (enterprise resource planning) system Active CN102566849B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201010582680.4A CN102566849B (en) 2010-12-10 2010-12-10 Method and device for acquiring tree-form data drawing output positions and ERP (enterprise resource planning) system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010582680.4A CN102566849B (en) 2010-12-10 2010-12-10 Method and device for acquiring tree-form data drawing output positions and ERP (enterprise resource planning) system

Publications (2)

Publication Number Publication Date
CN102566849A CN102566849A (en) 2012-07-11
CN102566849B true CN102566849B (en) 2014-01-08

Family

ID=46412407

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010582680.4A Active CN102566849B (en) 2010-12-10 2010-12-10 Method and device for acquiring tree-form data drawing output positions and ERP (enterprise resource planning) system

Country Status (1)

Country Link
CN (1) CN102566849B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106445931B (en) * 2015-08-04 2019-06-28 阿里巴巴集团控股有限公司 Database node incidence relation methods of exhibiting and device
CN106294686B (en) * 2016-08-05 2021-04-02 董涛 Method for rapidly updating tree node position coordinates in thought guide graph applied to computer technical field
CN108319991B (en) * 2017-01-16 2021-02-09 航天信息股份有限公司 Node engineering wiring diagram determining method and device
CN108536837B (en) * 2018-04-13 2022-04-01 上海渠杰信息科技有限公司 Knowledge tree generation method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1756188A (en) * 2004-09-30 2006-04-05 北京航空航天大学 Large-scale network topology graphics display method
CN1773494A (en) * 2005-10-20 2006-05-17 北京航空航天大学 Pattern drawing platform-oriented scene graph optimizational designing method
CN101042643A (en) * 2006-03-24 2007-09-26 国际商业机器公司 Method and device for regulating graphical user interface
CN101063972A (en) * 2006-04-28 2007-10-31 国际商业机器公司 Method and apparatus for enhancing visuality of image tree

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1756188A (en) * 2004-09-30 2006-04-05 北京航空航天大学 Large-scale network topology graphics display method
CN1773494A (en) * 2005-10-20 2006-05-17 北京航空航天大学 Pattern drawing platform-oriented scene graph optimizational designing method
CN101042643A (en) * 2006-03-24 2007-09-26 国际商业机器公司 Method and device for regulating graphical user interface
CN101063972A (en) * 2006-04-28 2007-10-31 国际商业机器公司 Method and apparatus for enhancing visuality of image tree

Also Published As

Publication number Publication date
CN102566849A (en) 2012-07-11

Similar Documents

Publication Publication Date Title
US20150089355A1 (en) Graphical tile-based layout
CN103310474B (en) A kind of implementation method of original handwriting and system
CA2517409C (en) Method, system, and computer-readable medium for creating and laying out a graphic within an application program
US9471957B2 (en) Method for partitioning, managing and displaying a collaboration space and interactive input system employing same
US11960512B2 (en) Identifying and graphically representing multiple parent nodes of a child node
US8161379B2 (en) Fit and fill techniques for pictures
KR102082541B1 (en) Selecting and editing visual elements with attribute groups
CN102467535B (en) Method, device and system for acquiring tree data output coordinate
CN107463302B (en) Icon layout adjusting method and device
CN102566849B (en) Method and device for acquiring tree-form data drawing output positions and ERP (enterprise resource planning) system
WO2019041653A1 (en) Mind map display method, device and apparatus, and storage medium
US20180349340A1 (en) Method for building a spreadsheet template with dynamic data transfer capabilities to a remote application
US9886465B2 (en) System and method for rendering of hierarchical data structures
WO2021008071A1 (en) Table processing method and apparatus, and intelligent interactive tablet and storage medium
US11829393B2 (en) Graphically representing related record families using a phantom parent node
US20200042640A1 (en) Identifying missing nodes within a graphically represented family
CN104978184B (en) Dynamic user interface placement algorithm
CN103247050A (en) Progressive image partitioning method
CN111428455B (en) Form management method, device, equipment and storage medium
US11539594B2 (en) Diagramming chlid nodes with multiple parent nodes
CN102254093A (en) Connected domain statistical correlation algorithm based on Thiessen polygon
CN103020402A (en) Modeling method and modeling device
CN109104627A (en) Focus Background Generation Method, storage medium, equipment and the system of Android TV
CN115202553A (en) Control method and device for whiteboard application and electronic equipment
CN104881433A (en) Remote sensing image storage method and remote sensing image storage system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant