Base java event POC
This commit is contained in:
39
src/main/java/ovh/gasser/newshapes/HTMLExporter.java
Normal file
39
src/main/java/ovh/gasser/newshapes/HTMLExporter.java
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user