From: Svjatoslav Agejenko Date: Sun, 22 Jul 2018 22:12:39 +0000 (+0300) Subject: Optimized frame repainting. Fixed mouse click processing. X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=commitdiff_plain;h=f5b086a876fc92f358032a12ffbecf854745bbaa;p=sixth-3d-demos.git Optimized frame repainting. Fixed mouse click processing. --- diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/life/Cell.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/life/Cell.java index 5817148..18f2d57 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/life/Cell.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/life/Cell.java @@ -15,7 +15,7 @@ class Cell extends AbstractCompositeShape implements /** * cell visual size */ - public static final int SIZE = 20; + static final int SIZE = 20; /** * Color of the active cell (R, G, B, A) */ @@ -98,18 +98,21 @@ class Cell extends AbstractCompositeShape implements } @Override - public void mouseClicked() { + public boolean mouseClicked() { setActive(!isActive()); + return true; } @Override - public void mouseEntered() { + public boolean mouseEntered() { setMouseOver(true); + return true; } @Override - public void mouseExited() { + public boolean mouseExited() { setMouseOver(false); + return true; } private void setMouseOver(final boolean isMouseOver) {