From 3fcaabac00ae23c054b6ea0bda6fa624b4513915 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Tue, 17 Jul 2018 20:24:53 +0300 Subject: [PATCH] Refactoring. --- .../java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java | 6 +++--- .../java/eu/svjatoslav/sixth/e3d/examples/life/Main.java | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) 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() { -- 2.20.1