Base java event POC

This commit is contained in:
2019-03-19 21:17:08 +01:00
parent 95cb82d419
commit 51885d8c53
16 changed files with 587 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
package ovh.gasser.newshapes;
import ovh.gasser.newshapes.shapes.SCollection;
import ovh.gasser.newshapes.shapes.SRectangle;
import ovh.gasser.newshapes.ui.html.*;
import java.awt.*;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
public class HTMLExporter {
private final SCollection model;
private HTMLExporter() throws FileNotFoundException {
model = 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 {
try (final PrintWriter html = new PrintWriter("out.html")) {
try (final PrintWriter css = new PrintWriter("style.css")) {
HTMLDraftman draftman = new HTMLDraftman(html, css);
draftman.generateHTML(this.model);
}
}
}
public static void main(String[] args) throws FileNotFoundException {
new HTMLExporter().export();
}
}