Summary of the invention
The object of the invention is to, a kind of method and apparatus that utilizes the Computerized Editing form is provided, can in cell, add oblique line, can also edit adjustment to the oblique line in the cell in the later stage equally, meet consumers' demand.
The method of utilizing the Computerized Editing form that the present invention proposes comprises: the instruction Oblique line drawing in described cell that receives the user; Calculate the intersection point in this oblique line place straight line and described cell sideline and the distance of this oblique line end points, judge that whether this distance is less than first threshold, if less than described first threshold, then will be adsorbed to described end points with the nearest intersection point of described end-point distances, the oblique line after the absorption will be added into described cell.
The present invention also proposes a kind of system that utilizes the Computerized Editing form simultaneously, comprise drafting module for the Oblique line drawing gauge outfit, be used for the computing module that data calculate and be used for receiving user instruction, and according to the receiver module of the user instruction sending controling instruction that receives to other modules;
Described receiver module receives user's instruction, and according to the user instruction sending controling instruction that receives to drafting module, described drafting module begins Oblique line drawing according to described steering order in described cell; Described computing module calculates the intersection point in this oblique line place straight line and described cell sideline and the distance of this oblique line end points, and result of calculation is sent to described drafting module;
Whether described drafting module judges described distance less than first threshold according to described result of calculation, if then will be adsorbed to described end points with the nearest intersection point of described end-point distances less than described first threshold, the oblique line after then will adsorbing is added into described cell.
The technical scheme that the present invention proposes, the cell oblique line is the part of cell, but not extra attached object, oblique line is the meeting automatic absorbing in drafting or change process, at utmost avoids user misoperation, improves user's office efficiency.
Embodiment
Embodiment 1:
The method of utilizing the Computerized Editing form that the present invention proposes, as shown in Figure 3.
Receive user instruction and in cell, begin Oblique line drawing.Whole drawing process judges that by the Origin And Destination of drawing the line of drawing is horizontal line, perpendicular line or oblique line.
According to the oblique line Origin And Destination of drawing, determine the straight line at this oblique line place.Represent the straight line at this oblique line place with straight line AB, the intersection point that intersect in straight line AB and cell sideline represents with alphabetical S and E respectively, represents certain end points of oblique line with P.
Calculate the distance of point of intersection S or E and end points P, suppose that point of intersection S and end points P are nearest apart, whether judge this distance less than first threshold, if less than first threshold, then will be adsorbed to end points P with the nearest point of intersection S of end points P, the oblique line after adsorbing is added into cell.The process of absorption is for moving to the coordinate of point of intersection S on the coordinate of end points P.The new oblique line that adds is namely as the oblique line gauge outfit in the cell.
Further improvement as above-described embodiment, oblique line after the absorption is added in the process of cell, judge after the absorption oblique line whether with cell in existing oblique line intersect, when existing oblique line is non-intersect in the oblique line after absorption and the cell, the oblique line after adsorbing is added into cell.Judge whether to intersect to increase the process of oblique line gauge outfit in the cell more intelligent, in situation about not intersecting with existing oblique line, the oblique line of the drafting after the absorption is added into the oblique line gauge outfit of this cell; If intersect with existing oblique line, then do not preserve the oblique line of new drafting, and withdraw from the drawing process of oblique line gauge outfit.Like this, guarantee to greatest extent the user to oblique line gauge outfit editor's accuracy, improve user's work efficiency.
As the further improvement of embodiment 1, if in the time of need to deleting the oblique line gauge outfit of having added, can carry out following steps: receive user instruction and choose oblique line, and the oblique line that deletion is chosen when receiving the triggering command of keyboard delete key.
As the further improvement of embodiment 1, if need to when all oblique lines are deleted in the cell, can carry out following steps: receive user instruction and choose whole cell, and when receiving the triggering command of keyboard delete key all oblique lines in the Delete Cells.
The mode that changes the oblique line gauge outfit comprises and moves horizontally oblique line or certain endpoint location of mobile oblique line, as the further improvement of embodiment 1, can carry out following steps:
Receive user instruction and choose oblique line to pull, and calculate respectively the distance that pulls starting point and oblique line end points, oblique line.Because changing the mode of oblique line gauge outfit can be to move horizontally this oblique line, also can be the position of mobile certain end points of oblique line, so determine according to pulling starting point.
Mobile oblique line single endpoint position: if the distance of the starting point of pulling and oblique line end points is less than first threshold, then adjust the distance and pull the nearest oblique line end points of starting point and pull, another does not draw new oblique line in the needs end points that pulls and the position that pulls terminal point according to oblique line, by the plane geometry knowledge of 2 definite straight lines, this new oblique line is the straight line that passes the motionless end points of oblique line and pull terminal point.The end points of new oblique line is adsorbed to oblique line end points nearest in the cell, the new oblique line after the absorption is added into cell.
Move horizontally this oblique line: if the distance of the starting point of pulling and oblique line is less than Second Threshold, then oblique line is pulled, according to the oblique line slope with pull the final position and draw new oblique line, new oblique line is to pass to pull terminal point and the slope straight line identical with choosing the oblique line slope.The end points of new oblique line is adsorbed to oblique line end points nearest in the cell, the new oblique line after the absorption is added into cell.
The mode that changes the oblique line gauge outfit also comprises: receives user instruction and chooses oblique line or oblique line end points, and when receiving the triggering command that keyboard direction is pressed, vertical or move horizontally oblique line or oblique line end points according to triggering command.For example, choose after certain bar oblique line, can also be according to the instruction of keyboard direction, for example the right key is pressed, and then this oblique line is turned right and is moved horizontally.
Process by above deletion or change oblique line gauge outfit further satisfies the user to editor's demand of oblique line gauge outfit.
In instructions of the present invention, first threshold and Second Threshold can preset.Marking different threshold values with " first, second ", only is the convenience for describing, and does not consist of restriction.
Embodiment 2:
Present embodiment also proposes a kind of system that utilizes the Computerized Editing form simultaneously, comprise: carry out the oblique line gauge outfit and draw the drafting module of operation, be used for the computing module that distance is calculated in the cell and be used for receiving user instruction, and send control command to the receiver module of other modules according to described instruction.
Receiver module receives user's instruction, and sends control command to drafting module according to described instruction.Drafting module begins Oblique line drawing according to steering order in cell; Computing module calculates the distance of intersection point and this oblique line end points in this oblique line place straight line and cell sideline, and result of calculation is sent to drafting module.
Drafting module judges that according to result of calculation whether the distance of calculating is less than first threshold, if then intersection point is adsorbed to corresponding end points less than first threshold, represent two intersection points with S and E, P represents certain oblique line end points, in the situation less than first threshold, if S point and P point are nearest among S and the E, then this S point is adsorbed to the P point.Then the oblique line after will adsorbing is added into cell.
As the further improvement of embodiment 2, utilize the system of Computerized Editing form also to comprise: to be used for the removing module of deletion oblique line gauge outfit and to intercept the module of intercepting of KeyEvent.In the time need to carrying out deletion action to the oblique line gauge outfit of having added, can and intercept module and realize by removing module.Receiver module receives user instruction, and according to the user instruction sending controling instruction that receives to removing module; Removing module is chosen oblique line according to steering order; Intercept module and intercept current KeyEvent, when listening to delete key and press, send triggering command that the keyboard delete key is pressed to removing module, the removing module oblique line that deletion is chosen according to triggering command.
If cell is the cell that does not comprise any literal, then can delete all oblique lines in the cell.Detailed process comprises: receiver module receives user instruction, and according to the user instruction sending controling instruction that receives to removing module; Removing module is chosen whole cell according to steering order; Intercept module and intercept current KeyEvent, when listening to delete key and press, send triggering command that the keyboard delete key is pressed to removing module, removing module is according to all oblique lines in the triggering command Delete Cells.
As the further improvement of embodiment 2, utilize the system of Computerized Editing form also to comprise: the mobile module that is used for mobile oblique line or oblique line endpoint location.
At first receiver module receives user instruction, according to the user instruction sending controling instruction that receives to mobile module.Mobile module chooses oblique line to pull according to steering order, and computing module calculates respectively the distance that pulls starting point and oblique line, oblique line end points, and result of calculation is sent to mobile module.
If the distance of the starting point of pulling and oblique line end points is less than first threshold, then mobile module is adjusted the distance and is pulled the nearest oblique line end points of starting point and pull, and will comprise another information that does not need the endpoint location that pulls and pull the final position of oblique line and be sent to drafting module.According to the plane geometry knowledge of 2 definite straight lines, drafting module is drawn new oblique line according to the information that receives, and new oblique line is to pass to pull terminal point and oblique line another does not need the straight line of mobile end points.Drafting module is adsorbed to oblique line end points nearest in the cell with the end points of new oblique line again, and the new oblique line after will adsorbing is added into cell.
If the distance of the starting point of pulling and oblique line is less than Second Threshold, then mobile module pulls oblique line, and the information that will comprise the oblique line slope and pull the final position is sent to drafting module, drafting module is drawn new oblique line according to the information that receives, by plane geometry knowledge as can be known this new oblique line be to pass to pull terminal point and the slope straight line identical with choosing the oblique line slope.Drafting module is adsorbed to oblique line end points nearest in the cell with the end points of new oblique line again, and the new oblique line after will adsorbing is added into cell.
Further improvement as above-described embodiment, in the process of Oblique line drawing gauge outfit, computing module can also judge after the absorption oblique line whether with cell in existing oblique line intersect, when existing oblique line is non-intersect in the oblique line after absorption and the cell, judged result is sent to drafting module.Drafting module is added into cell according to the judged result that receives with the oblique line after the absorption.By this crossing judge module, guarantee to greatest extent the user to oblique line gauge outfit editor's accuracy, improve user's work efficiency.
Above-described embodiment of the present invention does not consist of the restriction to protection domain of the present invention.Any modification of doing within the spirit and principles in the present invention, be equal to and replace and improvement etc., all should be included within the claim protection domain of the present invention.