Add HTML export action

This commit is contained in:
2025-02-19 11:45:32 +01:00
parent 1b0284cb4d
commit 55e74b5e4b
3 changed files with 20 additions and 5 deletions

View File

@@ -13,18 +13,21 @@ public class HTMLExporter {
private final SCollection model;
private HTMLExporter() throws FileNotFoundException {
model = SCollection.of(
this(SCollection.of(
SRectangle.create(10, 10, 40, 60, Color.RED),
SRectangle.create(70, 10, 40, 60),
SCollection.of(
SRectangle.create(100, 200, 40, 60, Color.MAGENTA),
SRectangle.create(150, 200, 40, 60, Color.MAGENTA)
)
);
export();
));
}
private void export() throws FileNotFoundException {
public HTMLExporter(SCollection model){
this.model = model;
}
public void export() throws FileNotFoundException {
try (final PrintWriter html = new PrintWriter("out.html")) {
try (final PrintWriter css = new PrintWriter("style.css")) {
HTMLDraftman draftman = new HTMLDraftman(html, css);