From: Svjatoslav Agejenko Date: Fri, 13 Jul 2018 21:56:06 +0000 (+0300) Subject: Removed ViewListener interface. Renamed View to ViewPanel. X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=commitdiff_plain;h=335758c2678788d95da705b28dbebe4ba206c103;p=sixth-3d-demos.git Removed ViewListener interface. Renamed View to ViewPanel. --- diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/GraphDemo.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/GraphDemo.java index 7bcaed7..e2ee634 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/GraphDemo.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/GraphDemo.java @@ -109,7 +109,7 @@ public class GraphDemo { final ViewFrame viewFrame = new ViewFrame(); - final ShapeCollection geometryCollection = viewFrame.getView() + final ShapeCollection geometryCollection = viewFrame.getViewPanel() .getContext().getRootShapeCollection(); Point3D location = new Point3D(-600, -300, 0); @@ -130,7 +130,7 @@ public class GraphDemo { location = new Point3D(600, 300, 0); geometryCollection.addShape(getFormula3Graph(location)); - viewFrame.getView().getContext().getAvatar() + viewFrame.getViewPanel().getContext().getAvatar() .setLocation(new Point3D(0, 0, -500)); } diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java index 9b87aac..f5a9d08 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java @@ -90,7 +90,7 @@ public class OctreeDemo extends WorldNavigationTracker { private void init() { final ViewFrame viewFrame = new ViewFrame(); - context = viewFrame.getView().getContext(); + context = viewFrame.getViewPanel().getContext(); context.getAvatar().setLocation(new Point3D(0, -30, -300)); @@ -125,7 +125,7 @@ public class OctreeDemo extends WorldNavigationTracker { shapeCollection.addShape(message); context.getKeyboardFocusTracker().setFocusOwner(this); - context.getView().repaintDuringNextViewUpdate(); + context.getViewPanel().repaintDuringNextViewUpdate(); } @Override @@ -164,7 +164,7 @@ public class OctreeDemo extends WorldNavigationTracker { // initialize and start Raytracer in a separate thread final RayTracer rayTracer = new RayTracer(camera.getTexture(), - octreeVolume, lights, camera, context.getView()); + octreeVolume, lights, camera, context.getViewPanel()); final Thread thread = new Thread(rayTracer); thread.start(); } diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/PointCloudDemo.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/PointCloudDemo.java index ae3d5c7..63d1b38 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/PointCloudDemo.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/PointCloudDemo.java @@ -20,7 +20,7 @@ public class PointCloudDemo { final ViewFrame viewFrame = new ViewFrame(); - final ShapeCollection geometryCollection = viewFrame.getView() + final ShapeCollection geometryCollection = viewFrame.getViewPanel() .getContext().getRootShapeCollection(); Transform transform = new Transform(new Point3D(0, -1000, 1000), 0, 0); diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/RainingNumbersDemo.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/RainingNumbersDemo.java index ad26a8b..557d5ff 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/RainingNumbersDemo.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/RainingNumbersDemo.java @@ -56,7 +56,7 @@ public class RainingNumbersDemo implements ViewRenderListener { private void run() throws IOException { final ViewFrame viewFrame = new ViewFrame(); - final ShapeCollection geometryCollection = viewFrame.getView() + final ShapeCollection geometryCollection = viewFrame.getViewPanel() .getContext().getRootShapeCollection(); Random random = new Random(); @@ -76,6 +76,6 @@ public class RainingNumbersDemo implements ViewRenderListener { geometryCollection.addShape(textCanvas); } - viewFrame.getView().addViewUpdateListener(this); + viewFrame.getViewPanel().addViewUpdateListener(this); } } diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/RandomPolygonsDemo.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/RandomPolygonsDemo.java index 5ff3bfd..7534148 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/RandomPolygonsDemo.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/RandomPolygonsDemo.java @@ -61,7 +61,7 @@ public class RandomPolygonsDemo { final ViewFrame viewFrame = new ViewFrame(); - final ShapeCollection shapeCollection = viewFrame.getView() + final ShapeCollection shapeCollection = viewFrame.getViewPanel() .getContext().getRootShapeCollection(); // add grid diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/SphereDemo.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/SphereDemo.java index 22b9dee..d89486f 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/SphereDemo.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/SphereDemo.java @@ -56,7 +56,7 @@ public class SphereDemo { public static void main(final String[] args) { final ViewFrame viewFrame = new ViewFrame(); - final ViewContext context = viewFrame.getView().getContext(); + final ViewContext context = viewFrame.getViewPanel().getContext(); final ShapeCollection geometryCollection = context .getRootShapeCollection(); diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/TextEditorDemo.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/TextEditorDemo.java index 7b19b10..ea2a867 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/TextEditorDemo.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/TextEditorDemo.java @@ -36,9 +36,9 @@ public class TextEditorDemo { public static void main(final String[] args) { final ViewFrame viewFrame = new ViewFrame(); - final ViewContext viewContext = viewFrame.getView().getContext(); + final ViewContext viewContext = viewFrame.getViewPanel().getContext(); - final ShapeCollection shapeCollection = viewFrame.getView() + final ShapeCollection shapeCollection = viewFrame.getViewPanel() .getContext().getRootShapeCollection(); shapeCollection.addShape(createGrid()); diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/life/Main.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/life/Main.java index 8397d20..99fc3e1 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/life/Main.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/life/Main.java @@ -50,7 +50,7 @@ public class Main extends WorldNavigationTracker { // create application frame visible to the user final ViewFrame viewFrame = new ViewFrame(); - final ShapeCollection shapeCollection = viewFrame.getView() + final ShapeCollection shapeCollection = viewFrame.getViewPanel() .getContext().getRootShapeCollection(); // add matrix @@ -59,7 +59,7 @@ public class Main extends WorldNavigationTracker { // add wireframe grid (optional) shapeCollection.addShape(createGrid()); - final ViewContext context = viewFrame.getView().getContext(); + final ViewContext context = viewFrame.getViewPanel().getContext(); setAvatarOrientation(context.getAvatar()); @@ -67,7 +67,7 @@ public class Main extends WorldNavigationTracker { context.getKeyboardFocusTracker().setFocusOwner(this); // Done! World is built. So ensure screen is updated too. - context.getView().repaintDuringNextViewUpdate(); + context.getViewPanel().repaintDuringNextViewUpdate(); } /**