Refactoring.
authorSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Tue, 17 Jul 2018 17:24:53 +0000 (20:24 +0300)
committerSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Tue, 17 Jul 2018 17:24:53 +0000 (20:24 +0300)
src/main/java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java
src/main/java/eu/svjatoslav/sixth/e3d/examples/life/Main.java

index 3234445..dd5ea4b 100755 (executable)
@@ -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,
index 3a633df..47698df 100644 (file)
@@ -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() {