projects
/
sixth-3d-demos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Code refactoring
[sixth-3d-demos.git]
/
src
/
main
/
java
/
eu
/
svjatoslav
/
sixth
/
e3d
/
examples
/
life
/
Cell.java
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
..
fb78e4b
100755
(executable)
--- 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.
*/
/**
* This class corresponds to a single cell within matrix.
*/
-
public
class Cell extends AbstractCompositeShape implements
+class Cell extends AbstractCompositeShape implements
MouseInteractionController {
/**
* cell visual size
*/
MouseInteractionController {
/**
* cell visual size
*/
-
public
static final int SIZE = 20;
+ static final int SIZE = 20;
/**
* Color of the active cell (R, G, B, A)
*/
/**
* Color of the active cell (R, G, B, A)
*/
@@
-27,11
+27,11
@@
public class Cell extends AbstractCompositeShape implements
/**
* Color of the inactive cell (R, G, B, A)
*/
/**
* Color of the inactive cell (R, G, B, A)
*/
- private static final Color INACTIVE_COLOR = new Color("55F
5
");
+ private static final Color INACTIVE_COLOR = new Color("55F
8
");
/**
* Color of the inactive cell (R, G, B, A) while mouse is over it.
*/
/**
* Color of the inactive cell (R, G, B, A) while mouse is over it.
*/
- private static final Color INACTIVE_COLOR_MOUSE_OVER = new Color("77F
7
");
+ private static final Color INACTIVE_COLOR_MOUSE_OVER = new Color("77F
8
");
/**
* A placeholder variable to help in next generation computation. Indicates
* whether cell is going to survive within next generation.
/**
* A placeholder variable to help in next generation computation. Indicates
* whether cell is going to survive within next generation.
@@
-56,7
+56,7
@@
public class Cell extends AbstractCompositeShape implements
}
private void createCellShape() {
}
private void createCellShape() {
- final double halfSize = SIZE / 2;
+ final double halfSize = SIZE / 2
f
;
// define 4 points corresponding to cell borders
final Point3D p1 = new Point3D(-halfSize, 0, -halfSize);
// define 4 points corresponding to cell borders
final Point3D p1 = new Point3D(-halfSize, 0, -halfSize);
@@
-98,18
+98,21
@@
public class Cell extends AbstractCompositeShape implements
}
@Override
}
@Override
- public
void
mouseClicked() {
+ public
boolean
mouseClicked() {
setActive(!isActive());
setActive(!isActive());
+ return true;
}
@Override
}
@Override
- public
void
mouseEntered() {
+ public
boolean
mouseEntered() {
setMouseOver(true);
setMouseOver(true);
+ return true;
}
@Override
}
@Override
- public
void
mouseExited() {
+ public
boolean
mouseExited() {
setMouseOver(false);
setMouseOver(false);
+ return true;
}
private void setMouseOver(final boolean isMouseOver) {
}
private void setMouseOver(final boolean isMouseOver) {