DIRECTORY Graph USING [Entity, NullRect, Text, ValueList, XY, Viewer], GraphPrivate USING [GraphHandle, GraphProc, PaintAction], GraphUtil USING [HandleNotNil, ViewerNotNil], Imager USING [Rectangle], ViewerOps USING [PaintViewer]; GraphDisplay: CEDAR PROGRAM IMPORTS GraphUtil, ViewerOps EXPORTS GraphPrivate = { OPEN Graph, GraphPrivate, GraphUtil; PaintAll: PUBLIC PROC [handle: GraphHandle _ NIL, clear, clientOnly: BOOL _ TRUE] = { IF HandleNotNil[handle] THEN { OPEN handle; paintInfo.item _ all; paintInfo.action _ paint; paintInfo.clear _ clear; IF clientOnly THEN PaintClient[handle] ELSE IF ViewerNotNil[chart.viewer] THEN ViewerOps.PaintViewer[ viewer: chart.viewer, hint: all, clearClient: clear, whatChanged: handle.paintInfo ]; chart.dirty _ FALSE; IF clear THEN zoomPt1 _ zoomPt2 _ []; }; }; -- PaintAll PaintRect: PUBLIC PROC [handle: GraphHandle _ NIL, action: PaintAction _ paint, clear: BOOL _ TRUE, rect: Imager.Rectangle _ NullRect] = { IF HandleNotNil[handle] THEN { OPEN handle; paintInfo.item _ rectangle; paintInfo.action _ action; paintInfo.clear _ clear; paintInfo.rect _ rect; PaintClient[handle]; }; }; -- PaintRect PaintText: PUBLIC PROC [handle: GraphHandle _ NIL, action: PaintAction _ paint, text: Text _ NIL] = { IF HandleNotNil[handle] AND text # NIL THEN { OPEN handle; paintInfo.item _ graphText; paintInfo.action _ action; paintInfo.text _ text; paintInfo.clear _ FALSE; PaintClient[handle]; }; }; -- PaintText PaintEntity: PUBLIC PROC [handle: GraphHandle _ NIL, action: PaintAction _ paint, entity: Entity _ NIL] = { IF HandleNotNil[handle] AND entity # NIL THEN { OPEN handle; paintInfo.item _ graphEntity; paintInfo.action _ action; paintInfo.entity _ entity; paintInfo.clear _ FALSE; PaintClient[handle]; }; }; -- PaintEntity PaintTails: PUBLIC PROC [handle: GraphHandle _ NIL, action: PaintAction _ paint, v1, v2: ValueList _ NIL, x1, x2: REAL _ 0.0] = { IF HandleNotNil[handle] AND v1 # NIL AND v2 # NIL THEN { OPEN handle; paintInfo.item _ tails; paintInfo.action _ action; paintInfo.clear _ FALSE; paintInfo.v1 _ v1; paintInfo.v2 _ v2; paintInfo.x1 _ x1; paintInfo.x2 _ x2; PaintClient[handle]; }; }; -- PaintTails PaintTarget: PUBLIC PROC [handle: GraphHandle _ NIL, action: PaintAction _ paint, choice: XY _ x] = { IF HandleNotNil[handle] THEN { OPEN handle; paintInfo.item _ target; paintInfo.action _ action; paintInfo.clear _ FALSE; paintInfo.xy _ choice; PaintClient[handle]; }; }; -- PaintTarget PaintGrids: PUBLIC PROC [handle: GraphHandle _ NIL, action: PaintAction _ paint, choice: XY _ x] = { IF HandleNotNil[handle] THEN { OPEN handle; paintInfo.item _ grid; paintInfo.action _ action; paintInfo.clear _ FALSE; paintInfo.xy _ choice; PaintClient[handle]; }; }; -- PaintGrids PaintClient: PUBLIC GraphProc = { OPEN handle; viewer: Viewer _ handle.chart.viewer; IF ViewerNotNil[viewer] THEN ViewerOps.PaintViewer[ viewer: viewer, hint: client, clearClient: handle.paintInfo.clear, whatChanged: handle.paintInfo ]; IF handle.paintInfo.action = erase THEN handle.chart.dirty _ TRUE; }; -- PaintClient }. LOG. SChen, created at October 9, 1985 6:10:49 pm PDT €GraphDisplay.mesa, Copyright c 1985 by Xerox Corporation. All rights reserved. Last edited: Sweetsun Chen, October 16, 1985 8:19:44 pm PDT This module deals with screen display (erase or paint). All public proc's in the module call Print with proper PaintInfo, which in turn calls Draw in GraphDraw. handle, handle.chart, and handle.chart.viewer should not be nil when any of these public paint procs are called. ΚK˜JšœΟmœ1™O™ Icode™.—J˜šΟk ˜ Jšœžœ%žœ ˜Jšœ˜Jšœ ˜ Jšœ˜Jšœ˜J˜—Jšœžœ˜Jšžœžœ˜%J˜—JšœΟc ˜—J˜š Ÿ œžœžœžœ&žœžœ(˜Ššžœžœžœ˜+J˜Jšœ˜Jšœ˜Jšœ˜J˜J˜—Jšœ  ˜—J˜š Ÿ œžœžœžœ,žœ˜eš žœžœžœžœžœ˜:Jšœ˜Jšœ˜Jšœ˜Jšœžœ˜J˜J˜—Jšœ  ˜—J˜š Ÿ œžœžœžœ0žœ˜kš žœžœ žœžœžœ˜