Skip to content

Commit 1f39094

Browse files
committed
Change sze buttons
1 parent a95ab04 commit 1f39094

File tree

6 files changed

+9
-6
lines changed

6 files changed

+9
-6
lines changed

build/classes/game/Game$6.class

0 Bytes
Binary file not shown.

build/classes/game/Game$7.class

0 Bytes
Binary file not shown.

build/classes/game/Game.class

-32 Bytes
Binary file not shown.

dist/GameOfLife.jar

9 Bytes
Binary file not shown.

src/game/Calculate.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private void evaluateCell(int row, int col, int[][] copy) {
8686
}
8787

8888
//Clean the grid
89-
public void restoreMatrix(){
89+
public void restoreMatrix() {
9090
if (population > 0) {
9191
for (int i = 0, c = 0; i < matrix.length && c < population; i++)
9292
for (int j = 0; j < matrix[i].length && c < population; j++)
@@ -130,4 +130,5 @@ public void setGeneration(long x) {
130130
public void setPopulation(long x) {
131131
population = x;
132132
}
133+
133134
}

src/game/Game.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void handle(ActionEvent event) {
8585
boxTop.setStyle("-fx-background-color: black;");
8686

8787
buttonStart = new Button("Start Game");
88-
buttonStart.setPrefSize((primaryScreenBounds.getWidth() * 0.077), (primaryScreenBounds.getWidth() * 0.021));
88+
buttonStart.setPrefSize(145, 40);
8989
buttonStart.getStyleClass().add("button");
9090
buttonStart.setOnAction(new EventHandler<ActionEvent>() {
9191
@Override
@@ -110,7 +110,7 @@ public void handle(ActionEvent e) {
110110

111111
buttonPause = new Button("Pause");
112112
buttonPause.setDisable(true);
113-
buttonPause.setPrefSize((primaryScreenBounds.getWidth() * 0.077), (primaryScreenBounds.getWidth() * 0.021));
113+
buttonPause.setPrefSize(145, 40);
114114
buttonPause.getStyleClass().add("button");
115115
buttonPause.setOnAction(new EventHandler<ActionEvent>() {
116116
@Override
@@ -125,7 +125,7 @@ public void handle(ActionEvent event) {
125125

126126
buttonStep = new Button("Step by step");
127127
buttonStep.setDisable(false);
128-
buttonStep.setPrefSize((primaryScreenBounds.getWidth() * 0.077), (primaryScreenBounds.getWidth() * 0.021));
128+
buttonStep.setPrefSize(145, 40);
129129
buttonStep.getStyleClass().add("button");
130130
buttonStep.setOnAction(new EventHandler<ActionEvent>() {
131131
@Override
@@ -143,7 +143,7 @@ public void handle(ActionEvent event) {
143143

144144
buttonRestore = new Button("Restore");
145145
buttonRestore.setDisable(false);
146-
buttonRestore.setPrefSize((primaryScreenBounds.getWidth() * 0.077), (primaryScreenBounds.getWidth() * 0.021));
146+
buttonRestore.setPrefSize(145, 40);
147147
buttonRestore.getStyleClass().add("button");
148148
buttonRestore.setOnAction(new EventHandler<ActionEvent>() {
149149
@Override
@@ -160,9 +160,11 @@ public void handle(ActionEvent event) {
160160
});
161161

162162
labelGeneration = new Label("Generation "+calculator.getGeneration());
163+
labelGeneration.setPrefSize(150, 40);
163164
labelGeneration.getStyleClass().add("label-information");
164165

165166
labelPopulation = new Label("Population "+calculator.getPopulation());
167+
labelPopulation.setPrefSize(150, 40);
166168
labelPopulation.getStyleClass().add("label-information");
167169

168170
boxTop.getChildren().addAll(buttonStart, buttonPause, buttonStep, buttonRestore, labelGeneration, labelPopulation);
@@ -182,7 +184,7 @@ public void handle(ActionEvent event) {
182184

183185
buttonRedefine = new Button("Redefine");
184186
buttonRedefine.getStyleClass().add("button");
185-
buttonRedefine.setPrefSize((primaryScreenBounds.getWidth() * 0.077), (primaryScreenBounds.getWidth() * 0.021));
187+
buttonRedefine.setPrefSize(145, 40);
186188
buttonRedefine.setOnMouseClicked(new EventHandler<MouseEvent>() {
187189
@Override
188190
public void handle(MouseEvent event) {

0 commit comments

Comments
 (0)