Search in sources :

Example 1 with AqlViewer

use of catdata.aql.gui.AqlViewer in project fql by CategoricalData.

the class AqlInACan method toHtml.

public static <X, Y> String toHtml(AqlEnv env, Instance<Ty, En, Sym, Fk, Att, Gen, Sk, X, Y> I) {
    String ret = "<div>";
    // TODO aql hardcoded
    Map<En, Pair<List<String>, Object[][]>> tables = new AqlViewer(256, env).makeEnTables(I.algebra());
    for (En t : Util.alphabetical(tables.keySet())) {
        ret += "<table id=\"table" + i + "\" style=\"float: left; border: 1px solid black; padding: 5px; border-collapse: collapse; margin-right:10px\" border=\"1\"  cellpadding=\"3\">";
        ret += "<caption><b>" + t.toString() + "</b></caption>";
        List<String> cols = tables.get(t).first;
        cols.remove(0);
        cols.add(0, "ID");
        Object[][] rows = tables.get(t).second;
        ret += "<tr>";
        int j = 0;
        for (String col : cols) {
            ret += "<th onclick=\"sortTable('table" + i + "', " + j + ")\">" + col + "</th>";
            j++;
        }
        ret += "</tr>";
        for (Object[] row : rows) {
            ret += "<tr>";
            for (Object col : row) {
                // System.ou
                ret += "<td>" + strip(col.toString()) + "</td>";
            }
            ret += "</tr>";
        }
        ret += "</table>";
        i++;
    }
    return ret + "</div><br style=\"clear:both;\"/>";
}
Also used : AqlViewer(catdata.aql.gui.AqlViewer) En(catdata.aql.exp.SchExpRaw.En) Pair(catdata.Pair)

Aggregations

Pair (catdata.Pair)1 En (catdata.aql.exp.SchExpRaw.En)1 AqlViewer (catdata.aql.gui.AqlViewer)1