Initial main window
[sixth.git] / src / main / java / eu / svjatoslav / sixth / core / Main.java
diff --git a/src/main/java/eu/svjatoslav/sixth/core/Main.java b/src/main/java/eu/svjatoslav/sixth/core/Main.java
new file mode 100644 (file)
index 0000000..c323932
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Sixth core user interface. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
+ */
+
+package eu.svjatoslav.sixth.core;
+
+import eu.svjatoslav.sixth.e3d.geometry.Point2D;
+import eu.svjatoslav.sixth.e3d.geometry.Point3D;
+import eu.svjatoslav.sixth.e3d.geometry.Rectangle;
+import eu.svjatoslav.sixth.e3d.gui.ViewFrame;
+import eu.svjatoslav.sixth.e3d.gui.ViewPanel;
+import eu.svjatoslav.sixth.e3d.gui.textEditorComponent.TextEditComponent;
+import eu.svjatoslav.sixth.e3d.math.Transform;
+import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
+import eu.svjatoslav.sixth.e3d.renderer.raster.ShapeCollection;
+import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line.LineAppearance;
+import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe.Grid2D;
+
+public class Main {
+
+    private static Grid2D createGrid() {
+        final Transform location = new Transform(
+                new Point3D(0, 100, 0),
+                0,
+                Math.PI / 2);
+
+        return new Grid2D(location,
+                new Rectangle(2000),
+                10,
+                10,
+                new LineAppearance(10, new Color("00b3ad")));
+    }
+
+    public static void main(final String[] args) {
+
+        final ViewFrame viewFrame = new ViewFrame();
+        final ViewPanel viewPanel = viewFrame.getViewPanel();
+
+        final ShapeCollection shapeCollection = viewFrame.getViewPanel()
+                .getRootShapeCollection();
+
+        shapeCollection.addShape(createGrid());
+
+
+        final TextEditComponent textEditor = new TextEditComponent(
+                new Transform(new Point3D(0, 0, 0)), viewPanel,
+                new Point2D(200, 120));
+
+        shapeCollection.addShape(textEditor);
+
+        viewPanel.getAvatar().setLocation(new Point3D(500, -300, -800));
+        viewPanel.getAvatar().setAngleXZ(0.6);
+        viewPanel.getAvatar().setAngleYZ(-0.5);
+
+    }
+}