use of j2html.tags.ContainerTag in project nivio by dedica-team.
the class SVGBackgroundFactory method getHex.
public static ContainerTag getHex() {
ContainerTag fullHex = (ContainerTag) new SVGHex(new Hex(0, 0), "none", "#cccccc").render();
fullHex.attr("id", "hex");
return fullHex;
}
use of j2html.tags.ContainerTag in project nivio by dedica-team.
the class SVGBackgroundFactory method getBackgroundTiles.
/**
* @param dimension svg dimesion, containing bounding boxes
* @return a set of "use" references to a background hex
*/
public static List<ContainerTag> getBackgroundTiles(SVGDimension dimension) {
// render background hexes
List<ContainerTag> background = new ArrayList<>();
var i = 0;
// add extra space for relations being drawn outside of group areas (which define the outer borders)
int horMin = dimension.hex.horMin - 1;
int horMax = dimension.hex.horMax + 1;
// why? without this bg hexes are displaced
final int yOffset = Hex.HEX_SIZE / 4;
for (int q = horMin; q <= horMax; q++) {
// the correction "+verticalmax -q" is because q and r are not orthogonal like x and y
for (int r = dimension.hex.vertMin - i; r < (horMax + dimension.hex.vertMax - q); r++) {
Point2D.Double hex = new Hex(q, r).toPixel();
int x = (int) hex.x - 2 * Hex.HEX_SIZE;
float y = (float) round((hex.y - yOffset) * 10f) / 10f;
if (y < dimension.cartesian.vertMin) {
continue;
}
if (y > dimension.cartesian.vertMax) {
continue;
}
ContainerTag use = SvgTagCreator.use("#" + HEX).attr("x", x).attr("y", y);
background.add(use);
}
i++;
}
return background;
}
use of j2html.tags.ContainerTag in project midpoint by Evolveum.
the class HtmlReportDataWriter method createTableBox.
protected String createTableBox(String aggregatedData, CommonHtmlSupport support, boolean parseData) {
StringBuilder table = new StringBuilder();
String style = support.getCssStyleOfTable();
String classes = support.getCssClassOfTable();
ContainerTag div = TagCreator.div().withClasses("box-body", "no-padding").with(TagCreator.h1(support.getTableName(localizationService))).with(TagCreator.p(GenericSupport.getMessage(localizationService, CommonHtmlSupport.REPORT_GENERATED_ON, support.getActualTime())));
String tableBox = TagCreator.div().withClasses("box", "boxed-table", classes).withStyle(style).with(div).render();
tableBox = tableBox.substring(0, tableBox.length() - 6);
String parsedData;
if (parseData) {
parsedData = parseAgregatedData(aggregatedData);
} else {
parsedData = aggregatedData;
}
table.append(tableBox).append("<table class=\"table table-striped table-hover table-bordered\">").append(parsedData).append("</table>").append("</div>");
return table.toString();
}
use of j2html.tags.ContainerTag in project midpoint by Evolveum.
the class HtmlReportDataWriter method formatColumn.
private ContainerTag formatColumn(List<String> values) {
ContainerTag div = TagCreator.div().withStyle("white-space: pre-wrap");
values.forEach((value) -> {
if (div.getNumChildren() != 0) {
div.with(TagCreator.br());
}
div.withText(value);
});
return div;
}
use of j2html.tags.ContainerTag in project civiform by seattle-uat.
the class AwsFileUploadViewStrategy method renderFileUploadBottomNavButtons.
Tag renderFileUploadBottomNavButtons(Params params) {
Optional<Tag> maybeContinueButton = maybeRenderContinueButton(params);
Optional<ContainerTag> maybeSkipOrDeleteButton = maybeRenderSkipOrDeleteButton(params);
ContainerTag ret = div().withClasses(ApplicantStyles.APPLICATION_NAV_BAR).with(div().withClasses(Styles.FLEX_GROW)).with(renderReviewButton(params));
if (maybeSkipOrDeleteButton.isPresent()) {
ret.with(maybeSkipOrDeleteButton.get());
}
ret.with(renderUploadButton(params));
if (maybeContinueButton.isPresent()) {
ret.with(maybeContinueButton.get());
}
return ret;
}
Aggregations