The localization method of a kind of flow chart node in browser window
Technical field
The present invention relates to the localization method of a kind of flow chart node in browser window.
Background technology
When browsing larger process flow diagram in a computer, more common process flow diagram acquiescence open mode is the top of process flow diagram.If user to want to browse in process flow diagram more rearward/node on the lower time, usually need more scrolling operations just can find the node wanting to browse, both time-consuming, require great effort again.
Summary of the invention
In view of this, fundamental purpose of the present invention is to provide the localization method of a kind of flow chart node in browser window, to reduce the destination node browsed in process flow diagram and the troublesome operation needed.
The localization method of a kind of flow chart node provided by the invention in browser window comprises the following steps:
A, select to need when process flow diagram is opened to appear at the node in browser window viewing area;
B, obtain the position of described node in process flow diagram painting canvas;
C, the width obtaining browser window and height;
D, according to the width of the position of described node in process flow diagram painting canvas and described browser window and height, determine to make described node to be presented at the position of process flow diagram painting canvas in described browser window on described browser window display page.
In the methods described above, described step B comprises:
The display object of described node in process flow diagram painting canvas is obtained, using the x in described display object attribute, y-axis coordinate as the position of described node in process flow diagram painting canvas according to the unique identification of described node.
In the methods described above, described step D comprises:
When the x-axis coordinate of described node and a predetermined deviation value sum are not more than the width of described browser window, the scroll bar of described browser window is remained on current horizontal level; Otherwise, in the horizontal direction by described scroll bar towards described node motion certain distance;
When the y-axis coordinate of described node and a predetermined deviation value sum are not more than the height of described browser window, described scroll bar is remained on current upright position; Otherwise, in vertical direction by described scroll bar towards described node motion certain distance.
In the methods described above, described scroll bar displacement is in the horizontal direction not less than the difference of a half width of described node x-axis coordinate and described browser window;
Described scroll bar displacement is in vertical direction not less than the difference of the half height of described node y-axis coordinate and described browser window.
In the methods described above, described step D comprises:
When the x-axis coordinate of described node and a predetermined deviation value sum are not more than the width of described browser window, process flow diagram painting canvas is remained on current horizontal level; Otherwise, pull described process flow diagram painting canvas in the horizontal direction, described process flow diagram painting canvas moved a certain distance towards described browser window in the horizontal direction;
When the y-axis coordinate of described node and a predetermined deviation value sum are not more than the height of described browser window, described process flow diagram painting canvas is remained on current upright position; Otherwise, pull described process flow diagram painting canvas in vertical direction, described process flow diagram painting canvas moved a certain distance towards described browser window in vertical direction.
In the methods described above, described process flow diagram painting canvas displacement is in the horizontal direction not less than the difference of a half width of described node x-axis coordinate and described browser window;
Described process flow diagram painting canvas displacement is in vertical direction not less than the difference of the half height of described node y-axis coordinate and described browser window.
As seen from the above, the inventive method can move process flow diagram painting canvas when process flow diagram is opened according to the position of selected node, be presented on the display page of browser window to make selected node, thereby reduce user and check operation needed for selected node, improve the Consumer's Experience of process flow diagram display in computing machine.
Accompanying drawing explanation
Fig. 1 is the localization method process flow diagram of flow chart node provided by the invention in browser window;
Fig. 2 is the effect schematic diagram using the inventive method realization flow node of graph location.
Embodiment
According to the localization method of flow chart node provided by the invention in browser window, when opening process flow diagram, automatically using as the default node locating of present node in the viewing area of browser.
Below in conjunction with accompanying drawing, introduce the localization method of flow chart node provided by the invention in browser window in detail.
As shown in Figure 1, above-mentioned localization method comprises the following steps:
Step 100: input and to need to appear at node in current browser window viewing area (hereafter will referred to as " present node ") when process flow diagram is opened.
For example, the unique identification of present node can be inputted in this step, to differentiate with other node.
Step 200: obtain the position of present node in process flow diagram painting canvas.
In this step, the display object of this present node in process flow diagram painting canvas (MovieClip) can be obtained according to the unique identification of present node.The position of present node in process flow diagram painting canvas is obtained thus according to the x in the display object attribute of present node, y-axis coordinate.
Step 300: the width and the height that obtain current browser window.
All comprise width and the height parameter of browser window in the attribute of current major browsers, therefore general need be read width and the height that browser attribute just can obtain browser window.
Step 400: according to width and the height of present node position and current browser window, determines to make present node to be presented at the position of process flow diagram painting canvas in current browser window on current browser window display page.
In general, the pattern of the manipulation process flow diagram painting canvas in the display page of browser window has two kinds: one is scroll bar pattern, namely comes the left and right of realization flow figure painting canvas in browser window display page/move up and down by slip horizontal/vertical scroll bar; Another kind pulls pattern, namely by pulling the left and right of process flow diagram painting canvas realization flow figure painting canvas in browser window display page/move up and down.It can thus be appreciated that, only need determine moving direction and the distance of scroll bar, and the drag direction of process flow diagram painting canvas and distance, the just position of adjustable process flow diagram painting canvas in browser window.The deterministic process of the position of process flow diagram painting canvas in current browser window is specific as follows:
Under scroll bar pattern, determine that the concrete grammar of (present node can be made to be presented on current browser window display page) process flow diagram painting canvas position in current browser window is as follows:
When the x-axis coordinate of present node and a predetermined deviation value (such as 80 pixels) sum are not more than the width of current browser window, can determine that the x-axis coordinate of present node is positioned within the width range of current browser window, therefore without the need to changing the current horizontal location of scroll bar, that is: scroll bar is remained on current horizontal level; Otherwise, need in the horizontal direction scroll bar to be moved a certain distance towards present node.This distance should be not less than the difference of a half width of present node x-axis coordinate and current browser window.Determine the horizontal level of scroll bar thus.
When the y-axis coordinate of present node and a predetermined deviation value (such as 80 pixels) sum are not more than the height of current browser window, can determine that the y-axis coordinate of present node is positioned within the altitude range of current browser window, therefore without the need to changing the current vertical position of scroll bar, that is: scroll bar is remained on current upright position; Otherwise, need in vertical direction scroll bar to be moved a certain distance towards present node.This distance should be not less than the difference of the half height of present node y-axis coordinate and current browser window.Determine the upright position of scroll bar thus.
By scroll bar being moved to the level and upright position that said process determines, just process flow diagram painting canvas can be made to be arranged in present node can be presented on the position of current browser window display page, and then demonstrate present node (as shown in Figure 2).
Determine that the concrete grammar of (present node can be made to be presented on current browser window display page) process flow diagram painting canvas position in current browser window is as follows pulling under pattern:
When the x-axis coordinate of present node and a predetermined deviation value (such as 80 pixels) sum are not more than the width of current browser window, can determine that the x-axis coordinate of present node is positioned within the width range of current browser window, therefore without the need to changing the current horizontal location of process flow diagram painting canvas, that is: process flow diagram painting canvas is remained on current horizontal level; Otherwise, need to pull process flow diagram painting canvas in the horizontal direction, process flow diagram painting canvas moved a certain distance towards current browser window in the horizontal direction.This distance should be not less than the difference of a half width of present node x-axis coordinate and current browser window.Determine the horizontal level of process flow diagram painting canvas thus.
When the y-axis coordinate of present node and a predetermined deviation value (such as 80 pixels) sum are not more than the height of current browser window, can determine that the y-axis coordinate of present node is positioned within the altitude range of current browser window, therefore without the need to changing the current vertical position of process flow diagram painting canvas, that is: process flow diagram painting canvas is remained on current upright position; Otherwise, need to pull process flow diagram painting canvas in vertical direction, process flow diagram painting canvas moved a certain distance towards current browser window in vertical direction.This distance should be not less than the difference of the half height of present node y-axis coordinate and current browser window.Determine the upright position of process flow diagram painting canvas thus.
By process flow diagram painting canvas being dragged to the level and upright position that said process determines, present node just can being made to be arranged on the position of current browser window display page, and then to demonstrate present node.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.