/**
* 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)
*/
/**
* Color of the inactive cell (R, G, B, A)
*/
- private static final Color INACTIVE_COLOR = new Color("55F5");
+ private static final Color INACTIVE_COLOR = new Color("55F8");
/**
* Color of the inactive cell (R, G, B, A) while mouse is over it.
*/
- private static final Color INACTIVE_COLOR_MOUSE_OVER = new Color("77F7");
+ private static final Color INACTIVE_COLOR_MOUSE_OVER = new Color("77F8");
/**
* A placeholder variable to help in next generation computation. Indicates
* whether cell is going to survive within next generation.
}
@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) {