HistogramsViewing.Mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Last tweaked by Mike Spreitzer on June 28, 1988 3:27:07 pm PDT
This interface provides Views&Controllers for Histogram Models.
DIRECTORY Histograms, IO, Rope, ViewerClasses;
HistogramsViewing: CEDAR DEFINITIONS = {OPEN Histograms;
Viewer: TYPE ~ ViewerClasses.Viewer;
Show:
PROC [
h: Histogram,
viewerInit: ViewerClasses.ViewerRec ← [],
format: ROPE ← NIL, --NIL means "%d"
width: NAT ← 0, --max number of chars produced when formatting
base: REAL ← 0.0, --base>1 means display count logarithmicly
updatePeriod: REAL ← -1.0, --If > 0, every updatePeriod seconds the viewer is repainted if it's out of date. If updatePeriod=0, the viewer is painted every time something changes. If updatePeriod<0, the viewer is never automatically repainted.
paint: BOOL ← TRUE] RETURNS [Viewer];
display it in a viewer
ViewerWrite: PROC [v: Viewer, to: IO.STREAM, create, show, data: BOOL];
}.