X-Git-Url: http://www2.svjatoslav.eu/gitweb/?p=sixth-3d-demos.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Fexamples%2Flife%2FCell.java;h=18f2d57ace15c5da5f6a3a503af730e304f8c855;hp=4d1cca0d372b0c74a279137c3be97fb55b1abec1;hb=f5b086a876fc92f358032a12ffbecf854745bbaa;hpb=151ac55eaaa0f3a2d7a589a0a3ff877b6db09a6f 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 4d1cca0..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 @@ -9,13 +9,13 @@ import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base.AbstractCom /** * This class corresponds to a single cell within matrix. */ -public class Cell extends AbstractCompositeShape implements +class Cell extends AbstractCompositeShape implements MouseInteractionController { /** * 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 @@ public 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) {