********************************************************************
* NOTE: This file is generated automatically from the event * definition file DGraph.evt. ********************************************************************<* PRAGMA LL *> MODULEevent handling methods:; <*NOWARN*> IMPORT AdjMatrix, TextPort, Rd, ZeusClass; <*NOWARN*> IMPORT DGraphViewClass, Filter, TextEditVBT, Fmt, ZFmt; <*NOWARN*> IMPORT Wr, ZeusPanel, FormsVBT, VBT, View; <* FATAL FormsVBT.Error, FormsVBT.Unimplemented *> REVEAL T = Public BRANDED OBJECT fv: FormsVBT.T := NIL; te: TextEditVBT.T := NIL; OVERRIDES init := TViewInit; install := TViewInstall; delete := TViewDelete; snapshot := TViewSnapshot; restore := TViewRestore; config := TViewConfig; reactivity := TViewReactivity; startrun := TViewStartrun; endrun := TViewEndrun; oeSetup := Setup; oeAddEdge := AddEdge; oeMarkEdge := MarkEdge; oeUnMarkEdge := UnMarkEdge; oeMarkVertex := MarkVertex; oeUnMarkVertex := UnMarkVertex; oeNewTree := NewTree; oeHighlight := Highlight; oeAddChild := AddChild; oeRemoveChild := RemoveChild; END; PROCEDURE DGraphTranscriptView TViewInit (view: T): T = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "init"); RETURN DGraphViewClass.T.init (view, NIL); END TViewInit; PROCEDUREClear (<* UNUSED *> fv : FormsVBT.T; <* UNUSED *> name: TEXT; cl : REFANY; <* UNUSED *> time: VBT.TimeStamp) = BEGIN TextPort.SetText(NARROW(cl, T).te.tp, "") END Clear; PROCEDURETViewInstall (view: T) = <* LL = VBT.mu *> BEGIN view.fv := ZeusPanel.NewForm("DGraphTranscriptView.fv"); view.te := FormsVBT.GetVBT(view.fv, "transcript"); TViewZTrace (view, "install"); FormsVBT.AttachProc(view.fv, "clear", Clear, view); EVAL Filter.Replace (view, view.fv); DGraphViewClass.T.install (view); END TViewInstall; PROCEDURETViewDelete (view: T) = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "delete"); DGraphViewClass.T.delete (view); END TViewDelete; PROCEDURETViewSnapshot (view: T; wr: Wr.T) RAISES {ZeusClass.Error} = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "snapshot"); DGraphViewClass.T.snapshot (view, wr); END TViewSnapshot; PROCEDURETViewRestore (view: T; rd: Rd.T) RAISES {ZeusClass.Error} = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "restore"); DGraphViewClass.T.restore (view, rd); END TViewRestore; PROCEDURETViewConfig ( view: T; state: ZeusClass.StateChange; o: ZeusClass.T) = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "config"); DGraphViewClass.T.config (view, state, o); END TViewConfig; PROCEDURETViewReactivity (view: T; <*UNUSED*> on: BOOLEAN) = <* LL = VBT.mu *> BEGIN TViewZTrace(view, "reactivity"); DGraphViewClass.T.reactivity (view, TRUE); END TViewReactivity; PROCEDURETViewStartrun (view: T) = <* LL = {} *> BEGIN TViewZTrace (view, "startrun"); DGraphViewClass.T.startrun (view); END TViewStartrun; PROCEDURETViewEndrun (view: T) = <* LL = {} *> BEGIN TViewZTrace (view, "endrun"); DGraphViewClass.T.endrun (view); END TViewEndrun;PROCEDURESetup (view: T; m: AdjMatrix.T) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "Setup ...") ELSE TViewTrace (view, "Setup " & AdjMatrix.ToText(m) ) END END END END Setup; PROCEDUREAddEdge (view: T; from, to: INTEGER) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "AddEdge ...") ELSE TViewTrace (view, "AddEdge " & Fmt.Int(from) & " " & Fmt.Int(to) ) END END END END AddEdge; PROCEDUREMarkEdge (view: T; from, to: INTEGER; depth: INTEGER) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "MarkEdge ...") ELSE TViewTrace (view, "MarkEdge " & Fmt.Int(from) & " " & Fmt.Int(to) & " " & Fmt.Int(depth) ) END END END END MarkEdge; PROCEDUREUnMarkEdge (view: T; from, to: INTEGER; depth: INTEGER) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "UnMarkEdge ...") ELSE TViewTrace (view, "UnMarkEdge " & Fmt.Int(from) & " " & Fmt.Int(to) & " " & Fmt.Int(depth) ) END END END END UnMarkEdge; PROCEDUREMarkVertex (view: T; v: INTEGER; depth: INTEGER; rcset: AdjMatrix.RCSet) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "MarkVertex ...") ELSE TViewTrace (view, "MarkVertex " & Fmt.Int(v) & " " & Fmt.Int(depth) & " " & AdjMatrix.RCToText(rcset) ) END END END END MarkVertex; PROCEDUREUnMarkVertex (view: T; v: INTEGER; depth: INTEGER; rcset: AdjMatrix.RCSet) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "UnMarkVertex ...") ELSE TViewTrace (view, "UnMarkVertex " & Fmt.Int(v) & " " & Fmt.Int(depth) & " " & AdjMatrix.RCToText(rcset) ) END END END END UnMarkVertex; PROCEDURENewTree (view: T; root: INTEGER; label: TEXT) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "NewTree ...") ELSE TViewTrace (view, "NewTree " & Fmt.Int(root) & " " & (label) ) END END END END NewTree; PROCEDUREHighlight (view: T; node: INTEGER; highlight: REAL; nodeOnly: BOOLEAN) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "Highlight ...") ELSE TViewTrace (view, "Highlight " & Fmt.Int(node) & " " & Fmt.Real(highlight) & " " & Fmt.Bool(nodeOnly) ) END END END END Highlight; PROCEDUREAddChild (view: T; parent, pred, child: INTEGER; label: TEXT) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "AddChild ...") ELSE TViewTrace (view, "AddChild " & Fmt.Int(parent) & " " & Fmt.Int(pred) & " " & Fmt.Int(child) & " " & (label) ) END END END END AddChild; PROCEDURERemoveChild (view: T; parent, ch: INTEGER) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "RemoveChild ...") ELSE TViewTrace (view, "RemoveChild " & Fmt.Int(parent) & " " & Fmt.Int(ch) ) END END END END RemoveChild; PROCEDURETViewZTrace (view: T; t: TEXT) = BEGIN IF view.fv # NIL THEN IF FormsVBT.GetBoolean(view.fv, "zeus") THEN TextPort.PutText(view.te.tp, "**zeus: " & t & "\n"); TextPort.Normalize(view.te.tp, LAST(INTEGER)) END END END TViewZTrace; PROCEDURETViewTrace (view: T; t: TEXT) = BEGIN TextPort.PutText(view.te.tp, "--event: " & t & "\n"); TextPort.Normalize(view.te.tp, LAST(INTEGER)) END TViewTrace; PROCEDURETViewNew (): View.T = BEGIN RETURN NEW(T).init() END TViewNew; BEGIN ZeusPanel.RegisterView (TViewNew, "DGraph Transcript View", "DGraph"); END DGraphTranscriptView.