10.2 Feedback

Bifrost supports two different forms of feedback. One is the feedback generated when the user is creating or modifying a graphical object. The primives in Bifrost for this kind of feedback is presented in section Canvas Primitives for Feedback and Segment Primitives for Feedback below.

The second kind is the feedback used, e.g., to identify a of selection of graphical objects, e.g. by highlighting of the control points or outlining the shape. This is elaborated upon in section Interaction Facilities in the Shape, which also presents other interaction facilities of the Shape pattern.

Finally section Modifiers and constraints deals with the notion of modifiers, i.e. pseudo-buttons used to modify the meaning of another key or a mouse button being pressed.

10.2.1 Canvas Primitives for Feedback

Feedback drawing is done in immediate mode, that is, the feedback is not a graphical object with a shape and a paint defined. Immediate drawings are not inserted into the canvas picture.

Immediate mode drawing is supported in the Canvas by the following operations, which should typically be performed in XOR mode to allow easy erasing (by simply redrawiingthe feedback a second time). Notice, that the Hilite and Unhilite patterns of graphical objects, as well as Initialize of the InteractionHandler pattern of Canvas automatically puts the Canvas into XOR mode.

Set the line width for subsequent immediate drawings.
Draws a line between the two points specified as arguments.
Takes one point as argument and draws a dot of the size of one device pixel at the point.
Takes one point as argument and draws a small filled square (approx. 2x2mm) around the point.
Draws a line between the points in the PointArray specified as arguments.
Takes one point, a width, and a height as arguments and draws a rectangle with Upperleft at the point.
Enters a text (possibly with embedded newlines), a position, and the text attributes FontName, Style, Size, and UnderLine, and draws the text at the position in the specified way.

10.2.2 Segment Primitives for Feedback

The building blocks of the shape, LineSegment and SplineSegment, define an operation DrawRubberBand, constructed by the immediate primitives above, to draw feedback:

Enters a point (NewPoint), an index into spline control points (ignored if the segment is a line segment), and a reference to the next segment (NextSeg) and draws a rubber line in either of the following two ways:
LineShape SplineSegment
This LineShape example has four line segments where two participate in the interaction. Draws a local spline rubberband around the control point specified at control index. NextSeg is used when the control index is the last index of the spline.
[2kb 144x115 GIF]
[2kb 144x98 GIF]

The Bifrost Graphics System - Reference Manual
© 1991-2004 Mjølner Informatics
[Modified: Tuesday October 24th 2000 at 22:29]