DIRECTORY Graph USING [Entity, EntityList, GraphHandle, PaintAction, PaintInfo, PaintInfoRec, Text, ValueList, XY, Viewer], GraphPrivate, GraphUtil USING [HandleNotNil, ReverseEntityList, ReverseValueList, ViewerNotNil], Imager USING [Rectangle], ViewerOps USING [PaintViewer]; GraphDisplay: CEDAR PROGRAM IMPORTS GraphUtil, ViewerOps EXPORTS GraphPrivate = { OPEN Graph, GraphUtil; PaintAll: PUBLIC PROC [handle: GraphHandle, clear, updateDivBds, clientOnly: BOOL] = { IF HandleNotNil[handle] THEN { OPEN handle; info: PaintInfo _ NEW[all PaintInfoRec _ [data: all[clear: clear, updateDivBds: updateDivBds]]]; IF ViewerNotNil[chart.viewer] THEN ViewerOps.PaintViewer[ viewer: chart.viewer, hint: IF clientOnly THEN client ELSE all, clearClient: clear, whatChanged: info ]; IF clear THEN { chart.dirty _ FALSE; zoomPt1 _ zoomPt2 _ []; }; }; }; -- PaintAll PaintAllCurves: PUBLIC PROC [handle: GraphHandle, clear: BOOL] = { IF HandleNotNil[handle] THEN { info: PaintInfo _ NEW[allCurves PaintInfoRec _ [action: paint, output: screen, data: allCurves[clear: clear]]]; PaintClient[handle, info]; }; }; -- PaintAllCurves PaintRect: PUBLIC PROC [handle: GraphHandle, rect: Imager.Rectangle, clear, updateDivBds: BOOL, action: PaintAction _ paint] = { IF HandleNotNil[handle] THEN { OPEN handle; info: PaintInfo _ NEW[rectangle PaintInfoRec _ [action: action, output: screen, data: rectangle[clear: clear, updateDivBds: updateDivBds, rect: rect]]]; PaintClient[handle, info]; }; }; -- PaintRect PaintText: PUBLIC PROC [handle: GraphHandle, text: Text, action: PaintAction _ paint] = { IF HandleNotNil[handle] AND text # NIL THEN { OPEN handle; info: PaintInfo _ NEW[graphText PaintInfoRec _ [action: action, output: screen, data: graphText[text: text]]]; PaintClient[handle, info]; }; }; -- PaintText PaintEntity: PUBLIC PROC [handle: GraphHandle, entity: Entity, withLegend: BOOL, action: PaintAction _ paint] = { IF HandleNotNil[handle] AND entity # NIL THEN { OPEN handle; info: PaintInfo _ NEW[graphEntity PaintInfoRec _ [action: action, output: screen, data: graphEntity[entity: entity]]]; PaintClient[handle, info]; IF withLegend THEN PaintLegend[handle, entity, action, TRUE]; }; }; -- PaintEntity PaintLegend: PUBLIC PROC [handle: GraphHandle, start: Entity, action: PaintAction _ paint, onlyOne: BOOL] = { IF HandleNotNil[handle] THEN { OPEN handle; info: PaintInfo _ NEW[legend PaintInfoRec _ [action: action, output: screen, data: legend[entity: start, onlyOne: onlyOne]]]; PaintClient[handle, info]; }; }; -- PaintLegend PaintTails: PUBLIC PROC [handle: GraphHandle, x1, x2: REAL, v1, v2: ValueList, entities: EntityList, action: PaintAction _ paint, reversed: BOOL _ TRUE] = { IF HandleNotNil[handle] AND v1 # NIL AND v2 # NIL THEN { OPEN handle; rV1, rV2: ValueList; rEL: EntityList; info: PaintInfo; IF reversed THEN { [rV1, ] _ GraphUtil.ReverseValueList[v1, FALSE]; [rV2, ] _ GraphUtil.ReverseValueList[v2, FALSE]; rEL _ GraphUtil.ReverseEntityList[entities, TRUE]; } ELSE {rV1 _ v1; rV2 _ v2; rEL _ entities}; info _ NEW[tails PaintInfoRec _ [action: action, output: screen, data: tails[x1, x2, rV1, rV2, rEL]]]; PaintClient[handle, info]; }; }; -- PaintTails PaintTarget: PUBLIC PROC [handle: GraphHandle, choice: XY, action: PaintAction _ paint] = { IF HandleNotNil[handle] THEN { OPEN handle; info: PaintInfo _ NEW[target PaintInfoRec _ [action: action, output: screen, data: target[xy: choice]]]; PaintClient[handle, info]; }; }; -- PaintTarget PaintGrids: PUBLIC PROC [handle: GraphHandle, choice: XY, long: BOOL, action: PaintAction _ paint] = { IF HandleNotNil[handle] THEN { OPEN handle; info: PaintInfo _ NEW[grid PaintInfoRec _ [action: action, output: screen, data: grid[xy: choice, long: long]]]; PaintClient[handle, info]; }; }; -- PaintGrids PaintClient: PUBLIC PROC [handle: GraphHandle, info: PaintInfo] = { OPEN handle; viewer: Viewer _ handle.chart.viewer; IF ViewerNotNil[viewer] THEN ViewerOps.PaintViewer[ viewer: viewer, hint: client, clearClient: FALSE, whatChanged: info ]; IF info.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, November 25, 1985 10:59:10 pm PST 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. refresh the axes and anything inside the axes. Plot legends of entities (starting from start). If start is nil, clean the place after the last legend entry. If onlyOne, only the legend for the starting entity is plotted. Κά˜JšœΟmœ1™O™ Icode™0—J˜šΟk ˜ JšœžœZžœ ˜qJ˜ Jšœ žœC˜RJšœžœ ˜Jšœ žœ˜J˜—šœžœž˜Jšžœ˜Jšžœ˜—J˜Jšžœ˜J™7J™hJ™pJ˜šΟnœžœžœ8žœ˜Všžœžœžœ˜+šœžœ˜(Jšœ7˜7—šžœžœ˜9Jšœ˜Jšœžœ žœžœ˜)Jšœ˜Jšœ˜J˜—šžœžœ˜Jšœžœ˜Jšœ˜J˜—J˜—JšœΟc ˜—J˜šŸœžœžœžœ˜BJ™.šžœžœ˜šœžœ˜.Jšœ@˜@—Jšœ˜J˜—Jšœ ˜—J˜šŸ œžœžœDžœ"˜€šžœžœžœ˜+šœžœ˜.Jšœ ˜ JšœH˜H—J˜J˜—Jšœ  ˜—J˜šŸ œžœžœC˜Yš žœžœžœžœžœ˜:šœžœ˜.Jšœ?˜?—J˜J˜—Jšœ  ˜—J˜šŸ œžœžœ3žœ"˜qš žœžœ žœžœžœ˜<šœžœ˜0JšœE˜E—Jšœ˜Jšžœ žœ%žœ˜=J˜—Jšœ ˜—J˜šŸ œžœžœLžœ˜mJ™/J™=J™?šžœžœžœ˜+šœžœ˜+JšœQ˜Q—Jšœ˜J˜—Jšœ ˜—J˜š Ÿ œžœžœžœRž œ˜œšžœžœžœžœžœžœžœ˜EJ˜J˜Jšœ˜šžœ žœ˜Jšœ)žœ˜0Jšœ)žœ˜0Jšœ,žœ˜2J˜—Jšžœ&˜*šœžœ˜JšœF˜F—Jšœ˜J˜—Jšœ  ˜—J˜šŸ œžœžœžœ"˜[šžœžœžœ˜+šœžœ˜+Jšœ<˜<—Jšœ˜J˜—Jšœ ˜—J˜š Ÿ œžœžœžœžœ"˜fšžœžœžœ˜+šœžœ˜)JšœF˜F—Jšœ˜J˜—Jšœ  ˜—J˜šŸ œžœžœ,žœ˜PJšœ%˜%šžœžœ˜3Jšœ˜Jšœ ˜ Jšœ žœ˜Jšœ˜J˜—Jšžœžœžœ˜6Jšœ ˜—J˜J˜šžœ˜J˜0——…—<œ