X-Git-Url: http://www2.svjatoslav.eu/gitweb/?p=sixth-3d-demos.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Fexamples%2FRainingNumbersDemo.java;h=c42f6f861371b24ad6de5edba1aafb41b9f10442;hp=ad26a8b7c3251c9c5510131fd240d37d1c2db22f;hb=63b799f7add2ebb5cd30b50c2581bc246f6e7b82;hpb=2150c62adc9f6b7696884422ffc47767f784fd9d 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..c42f6f8 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/RainingNumbersDemo.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/RainingNumbersDemo.java @@ -9,16 +9,15 @@ package eu.svjatoslav.sixth.e3d.examples; import eu.svjatoslav.sixth.e3d.geometry.Point3D; -import eu.svjatoslav.sixth.e3d.math.Transform; -import eu.svjatoslav.sixth.e3d.gui.ViewContext; import eu.svjatoslav.sixth.e3d.gui.ViewFrame; +import eu.svjatoslav.sixth.e3d.gui.ViewPanel; import eu.svjatoslav.sixth.e3d.gui.ViewRenderListener; +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.AbstractShape; import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.textcanvas.TextCanvas; -import java.io.IOException; import java.util.Collection; import java.util.Random; @@ -28,15 +27,15 @@ public class RainingNumbersDemo implements ViewRenderListener { private final static int AREA = 600; private final static int AREA_HALF = AREA / 2; - public static void main(final String[] args) throws IOException { + public static void main(final String[] args) { new RainingNumbersDemo().run(); } @Override - public boolean beforeRender(final ViewContext viewContext, + public boolean beforeRender(final ViewPanel viewPanel, final int millisecondsSinceLastFrame) { - final Collection shapes = viewContext + final Collection shapes = viewPanel .getRootShapeCollection().getShapes(); final double translateAmount = millisecondsSinceLastFrame / 50d; @@ -53,11 +52,11 @@ public class RainingNumbersDemo implements ViewRenderListener { return true; } - private void run() throws IOException { + private void run() { final ViewFrame viewFrame = new ViewFrame(); - final ShapeCollection geometryCollection = viewFrame.getView() - .getContext().getRootShapeCollection(); + final ShapeCollection geometryCollection = viewFrame.getViewPanel() + .getRootShapeCollection(); Random random = new Random(); @@ -76,6 +75,6 @@ public class RainingNumbersDemo implements ViewRenderListener { geometryCollection.addShape(textCanvas); } - viewFrame.getView().addViewUpdateListener(this); + viewFrame.getViewPanel().addViewUpdateListener(this); } }