TSTableImpl.Mesa
Created by Rick Beach, June 13, 1984 4:54:10 pm PDT
DIRECTORY
TableBase,
TableLayout,
TSArtwork,
TSGraphic,
TSOutput,
TSOutputDisplay,
ViewerClasses,
ViewerOps;
TSTableImpl: CEDAR PROGRAM
IMPORTS TableBase, TableLayout, TSArtwork, ViewerOps
=
BEGIN
TableFromBranch: TSArtwork.ObjectFromBranchProc = {
object ← NEW[TSGraphic.ObjectRec];
object.paintProc ← TablePaintProc;
object.layoutProc ← TableLayoutProc;
object.data ← TableBase.BranchToTable[node];
};
TableLayoutProc: TSGraphic.LayoutProc = {
table: TableBase.RefTable ← NARROW[self.data];
extent ← TableLayout.LayoutTable[table, maxX, maxY, suggestedX, suggestedY];
};
TablePaintProc: TSGraphic.PaintProc = {
table: TableBase.RefTable ← NARROW[self.data];
handle: TSOutput.Handle ← NARROW[context];
table.originX ← originX;
table.originY ← originY;
TableLayout.PaintTable[table, handle, originX, originY, extent];
IF ISTYPE[handle.outputState, TSOutputDisplay.DisplayState] THEN {
displayState: TSOutputDisplay.DisplayState ←
NARROW[handle.outputState, TSOutputDisplay.DisplayState];
v: ViewerClasses.Viewer ← displayState.viewer;
IF v # NIL THEN
ViewerOps.AddProp[v, $TableRef, table];
};
};
TSArtwork.Register["Table", TableFromBranch];
END.