********************************************************************
* NOTE: This file is generated automatically from the event
* definition file StringSearch.evt.
********************************************************************
<* PRAGMA LL *>
MODULE StringSearchTranscriptView ;
<*NOWARN*> IMPORT TextPort, Rd, ZeusClass, Filter, TextEditVBT;
<*NOWARN*> IMPORT Fmt, ZFmt, Wr, ZeusPanel, FormsVBT, VBT, View;
<*NOWARN*> IMPORT StringSearchViewClass;
<* 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;
oeProbe := Probe;
oeResult := Result;
oePartialMatch := PartialMatch;
oePartialMatchClear := PartialMatchClear;
oeCompleteMatch := CompleteMatch;
oeSlideTo := SlideTo;
oeKMPSetup := KMPSetup;
oeAddEdge := AddEdge;
END;
PROCEDURE TViewInit (view: T): T =
<* LL = VBT.mu *>
BEGIN
TViewZTrace (view, "init");
RETURN StringSearchViewClass.T.init (view, NIL);
END TViewInit;
PROCEDURE Clear (<* UNUSED *> fv : FormsVBT.T;
<* UNUSED *> name: TEXT;
cl : REFANY;
<* UNUSED *> time: VBT.TimeStamp) =
BEGIN
TextPort.SetText(NARROW(cl, T).te.tp, "")
END Clear;
PROCEDURE TViewInstall (view: T) =
<* LL = VBT.mu *>
BEGIN
view.fv := ZeusPanel.NewForm("StringSearchTranscriptView.fv");
view.te := FormsVBT.GetVBT(view.fv, "transcript");
TViewZTrace (view, "install");
FormsVBT.AttachProc(view.fv, "clear", Clear, view);
EVAL Filter.Replace (view, view.fv);
StringSearchViewClass.T.install (view);
END TViewInstall;
PROCEDURE TViewDelete (view: T) =
<* LL = VBT.mu *>
BEGIN
TViewZTrace (view, "delete");
StringSearchViewClass.T.delete (view);
END TViewDelete;
PROCEDURE TViewSnapshot (view: T; wr: Wr.T) RAISES {ZeusClass.Error} =
<* LL = VBT.mu *>
BEGIN
TViewZTrace (view, "snapshot");
StringSearchViewClass.T.snapshot (view, wr);
END TViewSnapshot;
PROCEDURE TViewRestore (view: T; rd: Rd.T) RAISES {ZeusClass.Error} =
<* LL = VBT.mu *>
BEGIN
TViewZTrace (view, "restore");
StringSearchViewClass.T.restore (view, rd);
END TViewRestore;
PROCEDURE TViewConfig (
view: T;
state: ZeusClass.StateChange;
o: ZeusClass.T) =
<* LL = VBT.mu *>
BEGIN
TViewZTrace (view, "config");
StringSearchViewClass.T.config (view, state, o);
END TViewConfig;
PROCEDURE TViewReactivity (view: T; <*UNUSED*> on: BOOLEAN) =
<* LL = VBT.mu *>
BEGIN
TViewZTrace(view, "reactivity");
StringSearchViewClass.T.reactivity (view, TRUE);
END TViewReactivity;
PROCEDURE TViewStartrun (view: T) =
<* LL = {} *>
BEGIN
TViewZTrace (view, "startrun");
StringSearchViewClass.T.startrun (view);
END TViewStartrun;
PROCEDURE TViewEndrun (view: T) =
<* LL = {} *>
BEGIN
TViewZTrace (view, "endrun");
StringSearchViewClass.T.endrun (view);
END TViewEndrun;
event handling methods:
PROCEDURE Setup (view: T; p, s: TEXT) =
<* 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 "
& (p)
& " "
& (s)
)
END
END
END
END Setup;
PROCEDURE Probe (view: T; i, j: CARDINAL) =
<* LL = {} *>
BEGIN
LOCK VBT.mu DO
IF FormsVBT.GetBoolean(view.fv, "alg") THEN
IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN
TViewTrace (view, "Probe ...")
ELSE
TViewTrace (view, "Probe "
& Fmt.Int(i)
& " "
& Fmt.Int(j)
)
END
END
END
END Probe;
PROCEDURE Result (view: T; res: BOOLEAN) =
<* LL = {} *>
BEGIN
LOCK VBT.mu DO
IF FormsVBT.GetBoolean(view.fv, "alg") THEN
IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN
TViewTrace (view, "Result ...")
ELSE
TViewTrace (view, "Result "
& Fmt.Bool(res)
)
END
END
END
END Result;
PROCEDURE PartialMatch (view: T; i, j, len: CARDINAL) =
<* LL = {} *>
BEGIN
LOCK VBT.mu DO
IF FormsVBT.GetBoolean(view.fv, "alg") THEN
IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN
TViewTrace (view, "PartialMatch ...")
ELSE
TViewTrace (view, "PartialMatch "
& Fmt.Int(i)
& " "
& Fmt.Int(j)
& " "
& Fmt.Int(len)
)
END
END
END
END PartialMatch;
PROCEDURE PartialMatchClear (view: T; ) =
<* LL = {} *>
BEGIN
LOCK VBT.mu DO
IF FormsVBT.GetBoolean(view.fv, "alg") THEN
IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN
TViewTrace (view, "PartialMatchClear ...")
ELSE
TViewTrace (view, "PartialMatchClear "
)
END
END
END
END PartialMatchClear;
PROCEDURE CompleteMatch (view: T; j: CARDINAL) =
<* LL = {} *>
BEGIN
LOCK VBT.mu DO
IF FormsVBT.GetBoolean(view.fv, "alg") THEN
IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN
TViewTrace (view, "CompleteMatch ...")
ELSE
TViewTrace (view, "CompleteMatch "
& Fmt.Int(j)
)
END
END
END
END CompleteMatch;
PROCEDURE SlideTo (view: T; j: CARDINAL) =
<* LL = {} *>
BEGIN
LOCK VBT.mu DO
IF FormsVBT.GetBoolean(view.fv, "alg") THEN
IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN
TViewTrace (view, "SlideTo ...")
ELSE
TViewTrace (view, "SlideTo "
& Fmt.Int(j)
)
END
END
END
END SlideTo;
PROCEDURE KMPSetup (view: T; p: TEXT) =
<* LL = {} *>
BEGIN
LOCK VBT.mu DO
IF FormsVBT.GetBoolean(view.fv, "alg") THEN
IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN
TViewTrace (view, "KMPSetup ...")
ELSE
TViewTrace (view, "KMPSetup "
& (p)
)
END
END
END
END KMPSetup;
PROCEDURE AddEdge (view: T; f, t: CARDINAL) =
<* 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(f)
& " "
& Fmt.Int(t)
)
END
END
END
END AddEdge;
PROCEDURE TViewZTrace (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;
PROCEDURE TViewTrace (view: T; t: TEXT) =
BEGIN
TextPort.PutText(view.te.tp, "--event: " & t & "\n");
TextPort.Normalize(view.te.tp, LAST(INTEGER))
END TViewTrace;
PROCEDURE TViewNew (): View.T =
BEGIN
RETURN NEW(T).init()
END TViewNew;
BEGIN
ZeusPanel.RegisterView
(TViewNew, "StringSearch Transcript View", "StringSearch");
END StringSearchTranscriptView.