From f5b086a876fc92f358032a12ffbecf854745bbaa Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Mon, 23 Jul 2018 01:12:39 +0300 Subject: [PATCH] Optimized frame repainting. Fixed mouse click processing. --- .../eu/svjatoslav/sixth/e3d/examples/life/Cell.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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) { -- 2.20.1