diff --git a/AlgebraicDataflowArchitectureModel/src/simulator/interfaces/html/HtmlElement.java b/AlgebraicDataflowArchitectureModel/src/simulator/interfaces/html/HtmlElement.java index 691a5e9..738faba 100644 --- a/AlgebraicDataflowArchitectureModel/src/simulator/interfaces/html/HtmlElement.java +++ b/AlgebraicDataflowArchitectureModel/src/simulator/interfaces/html/HtmlElement.java @@ -3,6 +3,9 @@ import java.util.HashMap; import java.util.Map; +import models.algebra.Constant; +import models.dataConstraintModel.MapTerm; + public class HtmlElement { private final String type; @@ -28,6 +31,19 @@ styles.remove(property); } + public MapTerm toMap() { + MapTerm res = new MapTerm(); + res.insert("type", new Constant(type)); + res.insert("id", new Constant(id)); + res.insert("text", new Constant(text)); + MapTerm stylesMap = new MapTerm(); + for(String prop : styles.keySet()) { + stylesMap.insert(prop, new Constant(styles.get(prop))); + } + res.insert("styles", stylesMap); + return res; + } + public String getType() { return type;