Graphic highlight adjacent a pointing cursor

Abstract: A technique is disclosed which facilitates the selection by a user of a graphic object on a display screen. Selection is by means of a pointing cursor which is moved about the display screen by means of a pointing device having a select button. When the pointing cursor is brought within a predetermined distance of a graphic object, the point on the graphic object closest to the pointing cursor is higlighted to show the user that that graphic object would be selected if the select button were pressed. If the user presses the select button when a point on a graphic object is highlighted, the entire graphic object is highlighted to indicate that it has been selected.

Description: The present invention generally relates to data editors and, more particularly to a technique for facilitating the selection by a user of a graphic object for editing. The invention has particular application in a multiple data editor characterized by a superblock structure containing two or more diverse object sets; however, the technique according to the present invention can be advantageously applied to specialized graphic editors and its therefore not limited to multiple data editors. The invention disclosed in this application is related in subject matter to the inventions discloses in the following patent applications published March 5, 1996, which are assigned to the assignee of this application : EP-A-0 173 123 for "Implicit Creation of a Superblock Structure in a Multiple Data Editor"; EP-A-0 173 122 for "Integrated Multiple Editor using a Superblock Structure". The article in "Proceedings of the Fall Joint computer Conference, Anaheim 14-16 November 1967, Vol.31, pages 713-721, J.D. JOYCE et al.: "Reactive displays : improving man-machine graphical communication", relates to techniques of graphic data management using intensification for highlighting parts of a display for improving the user's attention. IBM Technical Disclosure Bulletin, vol.21, no. 8, January 1979, page 3284, W.F. BEAUSOLEIL et al. : "Object identification and local highlighting on displays", discloses an object identification and local highlighting technique on displays. EP-A-0 114 422 relates to entity control for raster displays. US-A-4 017 680 discloses an image analyzing system in which an image of a field under analysis is displayed on a television monitor screen and features can be edited by adding or subtracting feature content to or from the display using a light pen. The article "W.M. Newman et al." Principles of Interactive Computer Graphics", Mc Graw-Hill, second edition (1979), pages 159-173, relates graphical input techniques, and particularly to the use of a gravity-field for improving the positioning of the pointing cursor. Background of the invention Graphic editors are used to edit graphic data which may be simple, such as simple graphs and charts, or highly complex, such as complex electrical or mechanical or architectural drawings. The latter are typically produced by computer aided design (CAD) systems. A CAD system may be characterized as being analogous to a word processing system, but for graphic data rather than text data. It is necessary in the course of editing graphic data for the user to select the data on the display screen which is to be edited. This is generally done by moving a pointing cursor on the screen with a pointing device, such as a mouse, to the desired graphic object and then selecting that object by, for example, pressing a button on the mouse provided for that purpose. While this process is quite straight forward, in actual practice it can, at times, prove to be very frustrating for the user. When the desired graphic object is close to some other graphic object, the wrong graphic object can be inadvertently selected. Thus, the user may thing that she is currently pointing to graphic object A and, after pressing the select button on the mouse, discovers that object B has been selected instead. In a complex graphics display, the user may have to try several times in order to make the correct selection. In the multiple data editor described, for example, in copending patent application referenced above, two or more diverse object sets may be positioned so that the object sets overlap one another, reside side-by-side, or extend above or below one another. The object sets may e text graphics or tables, for example, and because of the compact display of multiple object sets on a single page, there exits the same problem of selecting graphic data for editing. What is needed is a simple way to supply the user with useful information to aid in the selection of graphic data for editing. Summary of the invention It is therefore an object of the present invention to provide a technique for assisting a user of a graphic data editor in the selection of a displayed graphic object for editing. It is a further object of the invention to provide a multiple data editor in which multiple, diverse data sets including graphic data sets are easily edited with a user friendly way to select graphic objects within a graphic data set which may be displayed on the same screen as other and different data sets. The foregoing and other objects of the invention are accomplished by a method as defined in claim 1. Basically a pointing cursor is moved near a displayed graphic object, then the nearest point on the graphic object is highlighted. Highlighting the closes point in the graphic object may be by a small dot of increased intensity or color by a blinking dot or a small circle or other geometric figure or a combination of these. The highlighted point on the graphic object provides the user with a clear visual indication that that graphic object will be selected if the user presses the select button. Brief Description of the Drawings The foregoing and other objects, aspects and advantages of the invention will be better understood from the following detailed description of the invention with reference to the following drawings, in which: Figure 1 is an illustration of an all points addressable display screen on which is displayed several graphic objects; Figure 2 is an illustration of the gravity field of a line segment showing the relastionship of the pointing cursor to the line segment; Figure 3 is an illustration of the gravity field of a triangle showing the relationship of the pointing cursor to the triangle; Figure 4 is a flow chart summarizing the process for "Graphic_highlight"; and Figure 5 is a flow chart showing the process for "Nearest_Point". Detailed Description of a Preferred Embodiment of the Invention A pointing cursor as used herein is a cursor in the form of an arrow or other appropriate shape which is freely movable around a display screen. The means for moving the pointing cursor may be a keyboard with specially provided cursor keys, but in general practice the preferred means is a pointing device such as a mouse or digitizing tablet. Both of these devices operate as relative position devices wherein as the mouse, for example, is moved about on a flat surface, the displayed pointing cursor moves in the direction the mouse is moved. Typically, the mouse is picked up from the flat surface and then moved along the flat surface several times in the same general location in order to make the displayed pointing cursor move greater distances on the display screen. If the displayed pointing cursor is moved out of the displayed area, the display is made to scroll so that the pointing cursor always remains within the visual displayed area. A similar operation can be achieved with the digitizing tablet except that a hand-held cursor, not to be confused with the displayed pointing cursor, is moved over the surface of the digitizing tablet in order to effect movement of the displayed pointing cursor. The mouse and the hand-held cursor are generally provided with two or more buttons which may be easily pressed by the index finger, for example, of the user's hand which is holding the device. One of these buttons is typically the select button which, when pressed, indicates that the displayed object nearest the displayed pointing cursor is to be selected for some operation. Pointing cursors are used not only to select a graphic object for editing as in the subject invention, but also to select an icon representing a command in the application program. In the subject invention, as the user moves the displayed pointing cursor around a graphics area on a display screen, a small portion of a graphic object which is within a predetermined distance of the pointing cursor is highlighted to indicate to the user which graphic object will be selected if s/he presses the select button. This is illustrated in Figure 1 of the drawings which shows an all points addressable display screen on which several graphic objects are displayed. These include a circle 11, a rectangle 12, a triangle 13, and a polyline 14. A point 15 on the triangle is highlighted to indicate that the pointing cursor 16 is pointing at the triangle 13. Should the user press the select button, the entire graphic object, i.e., the triangle 13 for the case illustrated, is highlighted to indicate selection. It is also possible to deselect a selected graphic object, and this is done by moving the displayed pointing cursor away from the object and again pressing the select button. When this is done, the graphic is deselected and dehighligted. This feature further enhances the invention and adds to the user friendlyness of the graphic data editor. Figure 2 shows the gravity field 21 of a line segment 22. If the pointing cursor 23 is inside the area of the gravity field 21 of the line segment 22, it is considered as pointing to the line segment. Figure 3 shows the gravity field 31 of a triangle 32 which is the union of the gravity field of the line segments of the triangle. The gravity field extension box 33 is also shown. The pointing cursor 34 is in the gravity extension box 33 of the triangle 32; therefore, the system will consider whether the pointing cursor may be pointing at the triangle. Since the pointing cursor 34 is in the gravity field of a line segment 35 of the triangle 32, the cursor is pointing to the line segment 35. The nearest point on the line segment 35 to the cursor 34 is the point highlighted. If more than one line segment is pointed to by the pointing cursor 34, then the point nearest the pointing cursor is selected as the point to highlight, and the corresponding object is selected. The following is a pseudocode description of an implementation of the invention. The pseudocode is written in Program Design Language (PDL) from which source and object code may be readily derived by one of ordinary skill in the programming arts. This description represents the logic of the implementation. The performance of this implementation has been tested and found to work satisfactorily. The speed of the performance could be improved if the slope of every line segment of the graphics display were stored in the system instead of calculating slopes on the fly; however, a large amount of storage would be required to improve the speed of performance. The present implementation therefore represents a tradeoff between storage requirements and speed. In the following description, there are several definitions that must be made. First, the gravity field of a graphic object is defined as the area which surrounds the graphic object with a distance equal to a predefined value (ten pixels, for example). Second, the gravity field extension of a graphic object is defined as the minimum size of a rectangle which the gravity field fits into. Third, a graphic object is pointed by a pointing cursor if there exists a line segment within that object such that the distance between that line to the current pointing cursor position is either less than or equal to the predefined gravity distance. Figure 4 shows the flow chart for the "Graphic_Highlight" procedure. The starting point for this flow chart assumes that the operator is currently editing a graphic space using a mouse to position a pointing cursor on the display. Control will stay in this flow chart until the operator leaves the graphic space. Block 41 initializes both the pointed_object and previous point to nil. In block 42, the current position of the pointing cursor is read and the nearest point is computed by calling the procedure NEAREST_POINT. A test is made in decision block 43 on the result which is passed back from the procedure NEAREST POINT. If the current pointing cursor is pointing to a graphic object, then in block 44 the new point is set equal to the nearest point which was passed back from the procedure NEAREST_POINT. A test is then performed in decision block 45 to see if the previous point and the new point are the same. If they are not the same, then a test is made in decision block 46 to determine if the previous point is defined. If the previous point is defined, then the previous point is dehighlighted in block 47. In either case, the IF statement of decision block 46 is completed. The new point is highlighted in block 48, and the previous point is set equal to the new point. The IF statement of decision block 45 is then completed. If the pointing cursor is not pointing to any graphic object in decision block 43, then in decision block 49 a test is made to determine if the previous point is defined. If the previous point is defined implying that the previous point was the last highlighted point, then the previous point is dehighlighted in block 5⊘, and the previous point is set back to nil. The IF statement of decision block 49 is then completed followed by the completion of the IF statement in decision block 43. Then in decision block 51, a test is made to determine if the select button is pressed at this moment. If the select button is not pressed, then the process loops back to block 42. On the other hand, if the select button is pressed, then a test is made in decision block 52 to see if the pointed object is found. If it is found, then the whole graphic object is highlighted. In either case, the IF statement of the test in decision block 52 is completed, and the flow chart is exited. The following is a PDL listing for the "Nearest_Point" procedure. Again, a skilled programmer can derive source and object code from the this PDL listing. Initialize the nearest_distance to the predefined gravity distance. The flow chart for the "Nearest Point" procedure is shown in Figure 5. This flow chart is entered at block 61 by initializing the nearest distance to a previously defined gravity distance. The pointed object is also intialized, and the first graphic object in the graphic space is picked. In decision block 62 a test is made on the pointing cursor to see if it is inside the gravity field of this graphic object. If the test is true, then in block 63 the first line segment of this graphic object is retrieved. Next, in block 64, the distance between the current pointing cursor position and this line segment is computed. A test is made in decision block 65 to determine if the computed distance is less than the nearest distance. If the test is true, then in block 66 the pointed object is set equal to the current graphic object. In addition, the nearest distance is set equal to the current distance, and the nearest_(x,y) is set equal to the current pointing cursor position (x,y). The IF statement of decision block 65 is then completed and, in block 67, the next line segment within the current graphic object is retrieved. A test is made in decision block 68 to see if every line segment of the current graphic object has been examined. If not, then the procedure loops back to block 64; otherwise, the IF statement of decision block 62 is completed. Then, in block 69, the next graphic object within the graphic space is retrieved. A test is made in decision block 7⊘ to see if all the graphic objects within the graphic space have been examined. If not, then the procedure loops back to block 2; otherwise, the flow chart is exited. A pointing cursor positioned by means of a pointing device such as a mouse has been assumed in the description of the invention. It will be recognized by those skilled in the art that there are other functional equivalents such as, for example, a touch screen wherein a displayed graphic object is pointed to by an operator by simply touching the screen. Thus, it will be apparent that the use of a pointing cursor in the preferred embodiment may be replaced with other means of pointing based on movements or position of the operator or based on movements of a device controlled by the operator.

Claims: A method of selecting graphic objects including line segments on a display screen, said method including the steps of: a) displaying a pointing cursor on said display screen, said cursor being controlled by the operator, and initializing (41) a pointed_object parameter and previous-point parameter to nil; b) reading (42) the position of the pointing cursor and determining whether there exists a line segment displayed on the screen within a graphic object such that the distance between that line segment to the current pointing cursor position is either less than or equal to a predefined gravity distance, and if this is the case, setting a nearest-point parameter to be equal to the coordinates of the nearest point of a nearest such line segment and setting the pointed_object parameter to the graphic object comprising such line segment, otherwise setting said nearest-point parameter and said pointed-object parameter to nil; c) determining (43) whether said pointing cursor points to a graphic object by testing said nearest-point parameter and said pointed-object parameter; d) if said pointing cursor points to a graphic object, then setting (44) a new-point parameter to be equal to the nearest-point parameter; and d1 - checking (45) whether said new-point parameter and previous-point parameter are different and, if this is the case, testing (46) whether said previous-point parameter is not nil and, if this is the case, dehighlighting (47) the point on the screen whose coordinates correspond to said previous-point parameter; d2 - highlighting (48) a part of the graphic object comprising the point on the screen whose coordinates correspond to the new-point parameter and setting the previous point-parameter to be equal to the new-point parameter; e) if the pointing cursor does not point to a graphic object, determining (49) whether the previous-point parameter is not nil, implying that the point on said screen whose coordinates correspond to said previous-point parameter was the last highlighted point and, if this is the case, setting (50) the previous-point parameter to nil and dehighlighting (50) the point on the screen whose coordinates correspond to the previous-point parameter; and f) determining (51) whether a select button controlled by the operator is pressed and, if this is the case, testing (52) whether the pointed-object parameter is not nil and if this is the case, highlighting the graphic object on the screen corresponding to said pointed-object parameter. Method according to claim 1 wherein the computing of the nearest-point parameter of the line segments involve the steps of: a) initializing (61) a nearest-distance parameter to a predetermined gravity distance; b) - initializing the pointed-object parameter to nil and picking a first graphic object; c) - testing (62) whether said pointing cursor falls inside the gravity field of this first graphic object; d) - if the pointing cursor falls inside the gravity field of this first object, then retrieving (63) the first line segment of said first object, and performing the steps of: computing (64) the distance between said pointing cursor and said first line segment, determining (65) whether said computed distance is less than said nearest_distance parameter and, if this is the case, setting (66) the pointed_object parameter equal to the current graphic object, setting the nearest_distance parameter to be equal to said computed distance and setting the nearest-point parameter to the current pointing cursor position; repeating step d) for every line segment of said first object; and repeating steps c) and d) for every graphic object in order to return the pointed_object parameter along with the nearest-point parameter. The method according to claim 1 wherein said pointing cursor is moved on said display screen by means of a pointing device, and said graphic object can be selected by means of a select button. The method according to claim 3 wherein the step of highlighting is performed when said pointing cursor is moved to within said area surrounding said graphic object to indicate that said graphic object would be selected if said select button were pressed. The method according to claim 3 or 4 wherein the step of highlighting is performed by highlighting the point on the graphic object closest to said pointing cursor. The method according to claim 5 wherein highlighting the point is performed by increasing the intensity of the point. The method according to claim 5 wherein highlighting the point is performed by changing the color of the point. The method according to claim 5 wherein highlighting the point is performed by blinking the point on and off. The method according to claim 5 wherein highlighting the point is performed by displaying a geometric shape at the position of the point. The method according to claim 7 wherein the step of highlighting is performed by generating a circle surrounding the point. The method according to any one of the claims 5 to 10 further comprising the step of highlighting the entire graphic object having a point thereon highlighted when the select button is pressed. The method according to claim 11 wherein a selected graphic object can be deselected comprising the steps of: moving said pointing cursor away from the selected and highlighted graphic object; and pressing the select button again; and dehighlighting the now deselected graphic object.

Inventors: MCCASKILL REX ALLEN, WANG JOHN SHINYNAN, MCCASKILL, REX ALLEN, WANG, JOHN SHINYNAN
Applicants: IBM, INTERNATIONAL BUSINESS MACHINES CORPORATION
Application year: 1986
Main classification: G06F3
IPC codes: G09G5, G06F3