********************************************************************
* NOTE: This file is generated automatically from the event * definition file ShortestPath.evt. ********************************************************************<* PRAGMA LL *> MODULEevent handling methods:; <*NOWARN*> IMPORT TextConv, TextPort, Rd, ZeusClass, Filter; <*NOWARN*> IMPORT TextEditVBT, Fmt, ZFmt, Wr, ZeusPanel, FormsVBT; <*NOWARN*> IMPORT VBT, View, ShortestPathViewClass; <* 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; oeNewVertex := NewVertex; oeNewEdge := NewEdge; oeStartFind := StartFind; oePromote := Promote; oeConsider := Consider; oeTraceback := Traceback; END; PROCEDURE ShortestPathTranscriptView TViewInit (view: T): T = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "init"); RETURN ShortestPathViewClass.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("ShortestPathTranscriptView.fv"); view.te := FormsVBT.GetVBT(view.fv, "transcript"); TViewZTrace (view, "install"); FormsVBT.AttachProc(view.fv, "clear", Clear, view); EVAL Filter.Replace (view, view.fv); ShortestPathViewClass.T.install (view); END TViewInstall; PROCEDURETViewDelete (view: T) = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "delete"); ShortestPathViewClass.T.delete (view); END TViewDelete; PROCEDURETViewSnapshot (view: T; wr: Wr.T) RAISES {ZeusClass.Error} = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "snapshot"); ShortestPathViewClass.T.snapshot (view, wr); END TViewSnapshot; PROCEDURETViewRestore (view: T; rd: Rd.T) RAISES {ZeusClass.Error} = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "restore"); ShortestPathViewClass.T.restore (view, rd); END TViewRestore; PROCEDURETViewConfig ( view: T; state: ZeusClass.StateChange; o: ZeusClass.T) = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "config"); ShortestPathViewClass.T.config (view, state, o); END TViewConfig; PROCEDURETViewReactivity (view: T; <*UNUSED*> on: BOOLEAN) = <* LL = VBT.mu *> BEGIN TViewZTrace(view, "reactivity"); ShortestPathViewClass.T.reactivity (view, TRUE); END TViewReactivity; PROCEDURETViewStartrun (view: T) = <* LL = {} *> BEGIN TViewZTrace (view, "startrun"); ShortestPathViewClass.T.startrun (view); END TViewStartrun; PROCEDURETViewEndrun (view: T) = <* LL = {} *> BEGIN TViewZTrace (view, "endrun"); ShortestPathViewClass.T.endrun (view); END TViewEndrun;PROCEDURENewVertex (view: T; name: TEXT; x, y: REAL) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "NewVertex ...") ELSE TViewTrace (view, "NewVertex " & TextConv.Encode(name) & " " & Fmt.Real(x) & " " & Fmt.Real(y) ) END END END END NewVertex; PROCEDURENewEdge (view: T; name, from, to, orientation: TEXT) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "NewEdge ...") ELSE TViewTrace (view, "NewEdge " & TextConv.Encode(name) & " " & TextConv.Encode(from) & " " & TextConv.Encode(to) & " " & TextConv.Encode(orientation) ) END END END END NewEdge; PROCEDUREStartFind (view: T; from, to: TEXT) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "StartFind ...") ELSE TViewTrace (view, "StartFind " & TextConv.Encode(from) & " " & TextConv.Encode(to) ) END END END END StartFind; PROCEDUREPromote (view: T; edge: TEXT; sIndex, dIndex: INTEGER) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "Promote ...") ELSE TViewTrace (view, "Promote " & TextConv.Encode(edge) & " " & Fmt.Int(sIndex) & " " & Fmt.Int(dIndex) ) END END END END Promote; PROCEDUREConsider (view: T; edge: TEXT; sIndex, dIndex: INTEGER) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "Consider ...") ELSE TViewTrace (view, "Consider " & TextConv.Encode(edge) & " " & Fmt.Int(sIndex) & " " & Fmt.Int(dIndex) ) END END END END Consider; PROCEDURETraceback (view: T; edge: TEXT; sIndex, dIndex: INTEGER) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "Traceback ...") ELSE TViewTrace (view, "Traceback " & TextConv.Encode(edge) & " " & Fmt.Int(sIndex) & " " & Fmt.Int(dIndex) ) END END END END Traceback; 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, "ShortestPath Transcript View", "ShortestPath"); END ShortestPathTranscriptView.