From 90c83613d8ee3857503430de96f5427c64ca6af7 Mon Sep 17 00:00:00 2001 From: ucrhh Date: Fri, 29 Jan 2021 19:15:19 +0100 Subject: [PATCH] make MathjaxUnification consistent to itself --- .../MathjaxUnification.java | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/main/java/edu/kit/typicalc/view/content/typeinferencecontent/MathjaxUnification.java b/src/main/java/edu/kit/typicalc/view/content/typeinferencecontent/MathjaxUnification.java index b41e216..3cd49c0 100644 --- a/src/main/java/edu/kit/typicalc/view/content/typeinferencecontent/MathjaxUnification.java +++ b/src/main/java/edu/kit/typicalc/view/content/typeinferencecontent/MathjaxUnification.java @@ -1,14 +1,10 @@ package edu.kit.typicalc.view.content.typeinferencecontent; -import com.vaadin.flow.component.ClientCallable; import com.vaadin.flow.component.Tag; import com.vaadin.flow.component.dependency.JsModule; import com.vaadin.flow.component.littemplate.LitTemplate; -import com.vaadin.flow.component.notification.Notification; import edu.kit.typicalc.view.MathjaxAdapter; -import java.util.Arrays; - /** * Renders the constraints and unification from LaTeX using MathJax and allows step-by- * step-revealing capabilities. Relies on MathjaxUnificationJS to interact with MathJax. @@ -18,10 +14,7 @@ import java.util.Arrays; @JsModule("./src/mathjax-unification.ts") public class MathjaxUnification extends LitTemplate implements MathjaxAdapter { - private int stepCount = -1; -// -// @Id("tc-content") -// private Div content; + private final String[] latex; /** * Creates a new HTML element that renders the constraints and unification and @@ -29,21 +22,16 @@ public class MathjaxUnification extends LitTemplate implements MathjaxAdapter { * @param latex the LaTeX-String[] to render with MathJax */ public MathjaxUnification(String[] latex) { - Notification.show(Arrays.toString(latex)); + this.latex = latex; for (String s : latex) { getElement().callJsFunction("setTex", s); } - showStep(1); - } - - @ClientCallable - private void setStepCount(int stepCount) { - this.stepCount = stepCount; + showStep(0); } @Override public int getStepCount() { - return this.stepCount; + return this.latex.length; } @Override