From: Svjatoslav Agejenko Date: Tue, 17 Jul 2018 17:24:53 +0000 (+0300) Subject: Refactoring. X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=commitdiff_plain;h=3fcaabac00ae23c054b6ea0bda6fa624b4513915;p=sixth-3d-demos.git Refactoring. --- 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 3234445..dd5ea4b 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java @@ -129,13 +129,13 @@ public class OctreeDemo extends WorldNavigationTracker { } @Override - public void keyPressed(final KeyEvent event, final ViewPanel viewPanel) { + public boolean keyPressed(final KeyEvent event, final ViewPanel viewPanel) { if ('r' == event.getKeyChar()) { raytrace(); - return; + return true; } - super.keyPressed(event, viewPanel); + return super.keyPressed(event, viewPanel); } private void putPixel(final int x, final int y, final int z, 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 3a633df..47698df 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 @@ -29,7 +29,7 @@ public class Main extends WorldNavigationTracker { * Handle keyboard input. */ @Override - public void keyPressed(final KeyEvent event, final ViewPanel viewPanel) { + public boolean keyPressed(final KeyEvent event, final ViewPanel viewPanel) { switch (event.getKeyChar()) { case ' ': // space key MATRIX.evolve(false); @@ -41,8 +41,9 @@ public class Main extends WorldNavigationTracker { MATRIX.clear(); break; default: - super.keyPressed(event, viewPanel); + return super.keyPressed(event, viewPanel); } + return true; } private void run() {