DIRECTORY ChoiceButtons USING [EnumTypeRef], Containers USING [Container], Imager USING [ConstantColor, Context, Rectangle], ImagerFont USING [Font], Graph USING [AutoType, CaretIndex, ColorIndex, GRAPH, Entity, EntityColor, EntityGroup, EntityList, FontIndex, GraphColorsArray, GraphFontsArray, JustifX, JustifY, LastEntityColor, Mark, NullRect, ROPE, Text, Texts, XY, ValueList, Viewer], Menus USING [Menu], TiogaButtons USING [TiogaButton], TiogaOps USING [Ref]; GraphPrivate: CEDAR DEFINITIONS = { OPEN Graph; GraphHandle: TYPE = REF GraphHandleRec; -- the root of everything GraphHandleRec: TYPE = RECORD[ allTexts: Texts _ NIL, entityGroupList: EntityGroupList _ NIL, entityHash: EntityHash _ NIL, controller: Controller _ NIL, -- nil iff no controller viewer. chart: Chart _ NIL, graph: Graph.GRAPH _ NIL, lastEntityColor: EntityColor _ LastEntityColor, imagerFonts: ARRAY OutputType OF Fonts _ ALL[NIL], zoomPt1, zoomPt2: RECORD[set: BOOL _ FALSE, x, y: REAL _ 0.0] _ [], backgroundIndex: BackgroundIndex _ white, -- for display only. colorMap: ColorMap _ mine, colorMode: ColorMode _ color, paintInfo: PaintInfo _ NIL, realRect, axesRect: Imager.Rectangle _ NullRect, scale, step: ARRAY XY OF REAL _ ALL[0.0], windowTooLow: BOOL _ FALSE, waitingGraph: BOOL _ FALSE, selectProcId: INT _ 0, selectProc: PROCESS _ NIL, locked: BOOL _ FALSE, unlocked: CONDITION ]; Chart: TYPE = REF ChartRec; -- graph viewer and its data ChartRec: TYPE = RECORD[ viewer: Viewer _ NIL, caretState: ARRAY CaretIndex OF CaretState _ ALL[NIL], dirty: BOOL _ FALSE, autoRepaint: BOOL _ TRUE, selectedText: Text _ NIL, selectedEntity: Entity _ NIL, selectedEntityGroup: EntityGroup _ NIL -- no use in this version. ]; CaretState: TYPE = REF CaretStateRec; CaretStateRec: TYPE = RECORD[ x, y: INTEGER _ 0, visible, toBlink: BOOL _ FALSE ]; Controller: TYPE = REF ControllerRec; -- controller viewer and its data ControllerRec: TYPE = RECORD[ viewer: Viewer _ NIL, menu: Menus.Menu _ NIL, panel: Containers.Container _ NIL, table: Viewer _ NIL, panelVisible, tableNormalized: BOOL _ FALSE, panelHeight: INTEGER _ 400, -- (397 is enough to show everything) textsParent: TiogaOps.Ref _ NIL, swDivisions, divX, divY, swBounds, xmin, ymin, xmax, ymax: Viewer _ NIL, swCaret: ARRAY CaretIndex OF Viewer _ ALL[NIL], caretPlace: ARRAY CaretIndex OF ARRAY XY OF Viewer _ ALL[ALL[NIL]], swSlope, slope: Viewer _ NIL, swTarget, targetValue, targetWidth, targetColor: ARRAY XY OF Viewer _ ALL[NIL], swGrid: ARRAY XY OF Viewer _ ALL[NIL], colorIndex, red, green, blue, fontIndex, fontFamily, swBold, swItalic, vFontSize, pFontScale, textId, textContent, textPlaceX, textPlaceY, textColor, textFont, xValues, entityId, entityName, entityColor, entityWidth, entityMark, --entityGroupId, --entityValues, xsectionX, xsectionYs, argument: Viewer _ NIL, justifXRef, justifYRef, markRef, operandRef, angleRef: ChoiceButtons.EnumTypeRef _ NIL, auto: ARRAY AutoType OF BOOL _ ALL[TRUE], caretOn: ARRAY CaretIndex OF BOOL _ ALL[FALSE], targetOn, gridOn: ARRAY XY OF BOOL _ ALL[FALSE], slopeOn, boldOn, italicOn: BOOL _ FALSE, justifX: JustifX _ center, justifY: JustifY _ bottom, mark: Mark _ none, operand: Operand _ allY, angle: Angle _ radians ]; Fonts: TYPE = REF FontArray; FontArray: TYPE = ARRAY FontIndex OF ImagerFont.Font; EntityGroupList: TYPE = LIST OF EntityGroup; ControlAction: TYPE = {resume, update, remove, next, find, noop}; Operand: TYPE = {x, y, allY}; Angle: TYPE = {degrees, radians}; EntityHashSize: INT = 32; EntityHash: TYPE = REF EntityHashArray; EntityHashArray: TYPE = ARRAY [0..EntityHashSize) OF EntityList; BackgroundIndex: TYPE = {white, gray, darkGray, black, unknown}; ColorMode: TYPE = {color, bw}; ColorMap: TYPE = {mine, cedar, default, replace}; MaxStep: CARDINAL = 6; StepCount: TYPE = INTEGER[0..MaxStep); BWLineState: TYPE = REF LineStateRec; LineStateRec: TYPE = RECORD[ step: StepCount _ 0, progress: REAL _ 0.0 ]; GraphProc: TYPE = PROC [handle: GraphHandle _ NIL]; GraphPlaceProc: TYPE = PROC [handle: GraphHandle _ NIL, sx, sy: INTEGER _ 0]; GraphAtomProc: TYPE = PROC [handle: GraphHandle _ NIL, atom: ATOM]; PaintInfo: TYPE = REF PaintInfoRec; PaintInfoRec: TYPE = RECORD[ item: PaintItem _ all, action: PaintAction _ paint, output: OutputType _ screen, clear: BOOL _ TRUE, -- useful when item = all or rect. rect: Imager.Rectangle _ NullRect, -- useful when item = rect. text: Text _ NIL, -- useful when item = text. entity: Entity _ NIL, -- useful when item = entity. v1, v2: ValueList _ NIL, -- useful when item = tails. v1 is the y values at x1. x1, x2: REAL _ 0.0, -- useful when item = tails. xy: XY _ x ]; PaintAction: TYPE = {erase, paint}; OutputType: TYPE = {interpress, screen}; PaintItem: TYPE = {all, rectangle, graphText, graphEntity, tails, target, grid}; defaultColorsArray: GraphColorsArray; defaultFontsArray: GraphFontsArray; systemColor: ARRAY ColorIndex OF Imager.ConstantColor; -- exported from GraphViewer.mesa ShowController: GraphProc; IsController: PROC [viewer: Viewer] RETURNS [BOOL]; PaintAll: PROC [handle: GraphHandle, clear, clientOnly: BOOL _ TRUE]; PaintRect: PROC [handle: GraphHandle, action: PaintAction _ paint, clear: BOOL _ TRUE, rect: Imager.Rectangle _ NullRect]; PaintText: PROC [handle: GraphHandle, action: PaintAction _ paint, text: Text _ NIL]; PaintEntity: PROC [handle: GraphHandle, action: PaintAction _ paint, entity: Entity _ NIL]; PaintTails: PROC [handle: GraphHandle, action: PaintAction _ paint, v1, v2: ValueList _ NIL, x1, x2: REAL _ 0.0]; PaintTarget: PROC [handle: GraphHandle, action: PaintAction _ paint, choice: XY _ x]; PaintGrids: PROC [handle: GraphHandle, action: PaintAction _ paint, choice: XY _ x]; Paint: GraphProc; Draw: PROC [context: Imager.Context _ NIL, handle: GraphHandle]; SwitchAuto: PROC [handle: GraphHandle, type: AutoType _ bounds]; SwitchCaretVisibility, SwitchCaretBlinking: PROC [handle: GraphHandle, index: CaretIndex _ primary]; SwitchTarget, SwitchGrid: PROC [handle: GraphHandle, xy: XY _ x]; SelectPoint, SelectEntity, SlideOnSameCurve, SelectText, MoveSelText, ZoomIn, ZoomOut, ZoomPoint: GraphPlaceProc; ErasePrimary, MoveXhair2To1, EraseSelEntity, ShowSelEntityOnPanel, JumpLeftAnyCurve, JumpRightAnyCurve, JumpUpAnyCurve, JumpDownAnyCurve, JumpLeftSameCurve, JumpRightSameCurve, EraseSelText, ShowSelTextOnPanel, ZoomWithZoomPts, ClearZoomBox: GraphProc; SlideLeftNSteps, SlideRightNSteps: PROC [handle: GraphHandle, nSteps: INT _ 0]; HandleFromFile: PROC [file: ROPE _ NIL] RETURNS [handle: GraphHandle _ NIL, msg: ROPE _ NIL]; GetGraph: PROC [handle: GraphHandle, file: ROPE _ NIL] RETURNS [msg: ROPE _ NIL]; SaveGraph: PROC [viewer: Viewer, toFile: ROPE _ NIL] RETURNS [msg: ROPE _ NIL]; WriteGraphFile: PROC [ref: REF ANY, file: ROPE _ NIL] RETURNS [msg: ROPE _ NIL]; WriteDataFile: PROC [graph: GRAPH _ NIL, file: ROPE _ NIL] RETURNS [msg: ROPE _ NIL]; ChartMenus, ControllerMenus: PROC [] RETURNS [menu: Menus.Menu]; Lock: GraphProc; Unlock: GraphProc; IsLocked: PROC [handle: GraphHandle] RETURNS [BOOL]; CallWithLock: PROC [handle: GraphHandle, proc: GraphProc _ NIL]; LockedPlaceProc: PROC [handle: GraphHandle, sx, sy: INTEGER _ 0, proc: GraphPlaceProc _ NIL]; LockedAtomProc: PROC [handle: GraphHandle, atom: ATOM, proc: GraphAtomProc _ NIL]; Wait: PROC; FlipToggleOnPanel: GraphAtomProc; MakePanel: PROC [handle: GraphHandle] RETURNS [lastHeight: INTEGER]; Operate: GraphAtomProc; PanelRemove: GraphAtomProc; RemoveText: PROC[handle: GraphHandle, text: Text]; RemoveEntity: PROC[handle: GraphHandle, entity: Entity]; Resume: GraphAtomProc; ShowText: PROC [handle: GraphHandle, text: Text _ NIL]; ShowEntity: PROC [handle: GraphHandle, entity: Entity _ NIL]; ResumeTextFields: PROC[handle: GraphHandle, text: Text _ NIL]; ResumeEntityFields: PROC [handle: GraphHandle, entity: Entity _ NIL]; MakeTable: PROC[handle: GraphHandle, lastHeight: INTEGER]; AddTextButton: PROC [handle: GraphHandle, text: Text _ NIL] RETURNS [b: TiogaButtons.TiogaButton _ NIL]; AddEntityButton: PROC [handle: GraphHandle, entity: Entity _ NIL] RETURNS [b: TiogaButtons.TiogaButton _ NIL]; Update: GraphAtomProc; ShowChart: GraphProc; IsGraphViewer: PROC [viewer: Viewer] RETURNS [BOOL]; }. CHANGE LOG. SChen, created at October 9, 1985 5:50:44 pm PDT. dFile: GraphPrivate.mesa, Copyright c 1985 by Xerox Corporation. All rights reserved. Last Edited: Sweetsun Chen, October 21, 1985 10:17:45 pm PDT types texts and entities vars useful for drawing All refer to the axes box. But realRect is for real data; and axesRect is for screen. scale = (d screen)/(d real); step is the step size betw ticks (for real data). meaningful to GraphEdit.SelectEntity and GraphEdit.ClosestEntity. lock "visible" here means that it can be seen on the chart at this moment. it may be termperarily false (disappear) due to blinking effect. blinking can be manifested only if graph.caret[index].visible is true. groupId, groupName, xId, yIds, curve hash table public vars procedures implemented by GraphController: implemented by GraphDisplay: implemented by GraphDraw: implemented by GraphEdit: implemented by GraphFile: implemented by GraphMenus: implemented by GraphMonitor: implemented by GraphPanel: implemented by GraphOperations: implemented by GraphRemove: implemented by GraphResume: implemented by GraphTable: implemented by GraphUpdate: implemented by GraphViewer: Κ ~˜Jšœ#Οmœ1™U™ Icode™/—J˜šΟk ˜ Jšœžœ˜"Jšœ žœ ˜Jšœžœ%˜1Jšœ žœ˜Jš œžœ$žœ‘žœžœ˜οJšœžœ˜Jšœ žœ˜!Jšœ žœ˜—J˜Jšœžœž œžœ˜/J™Jšœ™Jšœ žœžœΟc˜Ašœžœžœ˜J™Jšœžœ˜Jšœ#žœ˜'Jšœžœ˜J˜JšœžœŸ ˜>Jšœžœ˜Jšœ žœžœ˜J˜Jšœ/˜/Jš œ žœ žœ žœžœ˜2J˜Jšœ™Jš œžœžœžœžœ ˜CJšœ*Ÿ˜>Jšœ˜J˜Jšœžœ˜šœ0˜0JšœU™U—š œ žœžœžœžœžœ˜)JšœN™N—Jšœžœžœ˜J˜Jšœžœžœ˜Jšœžœ˜šœ žœžœ˜JšœA™A—J™Jšœžœžœ˜Jšœ ž ˜J˜—J˜Jšœžœžœ Ÿ˜8šœ žœžœ˜Jšœžœ˜Jš œ žœ žœžœžœ˜6Jšœžœžœ˜Jšœ žœžœ˜Jšœžœ˜Jšœžœ˜Jšœ#žœŸ˜AJ˜J˜Jšœ žœžœ˜%šœžœžœ˜Jšœžœ˜Jšœžœž˜JšœE™EJ™@JšœF™FJ˜——J˜Jšœ žœžœŸ!˜Gšœžœžœ˜Jšœžœ˜Jšœžœ˜Jšœžœ˜"Jšœžœ˜J˜Jšœžœžœ˜,Jšœ žœŸ%˜AJšœžœ˜ J˜Jšœ˜Jšœ+žœ˜/Jš œ žœ žœ žœžœ˜/Jšœ žœ žœžœžœžœ žœžœžœ˜CJšœžœ˜Jš œ1žœžœžœ žœžœ˜OJš œžœžœžœ žœžœ˜&Jšœ˜Jšœ?˜?JšœA˜AJ˜Jšœ<Ÿœ ˜\Jšœ™J˜Jšœ˜Jšœžœ˜J˜JšœSžœ˜WJ˜Jš œžœ žœžœžœžœ˜)Jš œ žœ žœžœžœžœ˜/Jš œžœžœžœžœžœžœ˜0Jšœžœžœ˜(Jšœ˜Jšœ˜J˜Jšœ˜Jšœ˜J˜—J˜Jšœžœžœ ˜Jšœ žœžœ žœ˜5J˜Jšœžœžœžœ ˜,Jšœžœ.˜AJšœ žœ˜Jšœžœ˜!J˜J™Jšœžœ˜Jšœ žœžœ˜'Jšœžœžœžœ ˜@J˜Jšœžœ+˜@Jšœ žœ˜Jšœ žœ#˜1Jšœ žœ˜Jšœ žœžœ ˜&Jšœ žœžœ˜%šœžœžœ˜Jšœ˜Jšœ žœ˜J˜—J˜JšΟn œžœžœžœ˜3Jš  œžœžœžœ žœ˜MJš   œžœžœžœžœ˜CJ˜Jšœ žœžœ˜#šœžœžœ˜Jšœ˜Jšœ˜J˜JšœžœžœŸ"˜6Jšœ#Ÿ˜>Jšœ žœŸ˜-JšœžœŸ˜3JšœžœŸ6˜OJšœžœŸœŸ˜0Jšœžœ˜ J˜J˜Jšœ žœ˜#Jšœ žœ˜(Jšœ žœA˜P—J˜J™ Jšœ%˜%Jšœ#˜#Jšœ žœ žœŸ!˜XJ™J™ šœ™Jšœ˜Jš  œžœžœžœ˜3—J™™Jš œžœ*žœžœ˜EJš  œžœ;žœžœ%˜zJš  œžœAžœ˜UJš  œžœEžœ˜[Jš  œžœHžœ žœ˜qJš  œžœ<žœ˜UJš  œžœ<žœ˜TJš œ ˜—J™™Jš œžœžœ˜@—J™™Jš  œžœ0˜@J˜Jšœ˜Jš œžœ4˜MJ˜Jšœ ˜ Jš  œžœžœ˜3J˜Jšœ ˜ Jšœ ˜ Jšœ˜Jšœ ˜ Jšœ ˜ Jšœ˜Jšœ˜Jšœ˜J˜Jšœ ˜ Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ ˜ Jšœ˜Kšœ˜Jšœ˜J˜Jšœ˜Jš œžœžœ˜>—J™™Jš œžœžœžœžœžœžœžœ˜]Jš œžœžœžœžœžœžœ˜QJš  œžœžœžœžœžœžœ˜OJš œžœžœžœžœžœž œžœžœ˜PJš  œžœžœžœžœžœž œžœžœ˜U—J˜™Jš  œ œžœžœ˜@—J™™Jš œ ˜Jš œ ˜Jš œžœžœžœ˜4Jš  œžœ)žœ˜@Jš œžœžœžœ˜]Jš œžœžœžœ˜RJš œžœ˜ —J˜šœ™Jšœ!˜!Jš  œžœžœžœ˜D—J™™Jšœ˜—J™™Jšœ˜Jš  œžœ"˜2Jš  œžœ&˜8—J™™Jšœ˜Jš œžœ$žœ˜7Jš  œžœ(žœ˜=Jš œžœ#žœ˜>Jš œžœ(žœ˜E—J™™Jš  œžœ"žœ˜:Jš   œžœ$žœžœ žœ˜hJš  œžœ(žœžœ žœ˜n—J™™Jšœ˜—J™™Jšœ˜Jš  œžœžœžœ˜4—J˜J™šžœžœ˜ Jšœ-žœ˜1—J™—…— T06