-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added images for buttons, removing some hard coded text
- Loading branch information
1 parent
6c7fb64
commit 3b160c6
Showing
17 changed files
with
143 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="src" path="images"/> | ||
<classpathentry kind="src" path="data"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package cellsociety_team04; | ||
|
||
public class FireWindow extends Window { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,95 @@ | ||
package cellsociety_team04; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import javafx.animation.KeyFrame; | ||
import javafx.animation.Timeline; | ||
import javafx.scene.control.Button; | ||
import javafx.scene.layout.GridPane; | ||
import javafx.scene.shape.Rectangle; | ||
import javafx.util.Duration; | ||
|
||
public abstract class SimulationWindow extends Window { | ||
protected boolean start; | ||
protected Button run; | ||
protected Button step; | ||
protected double mySpeed; | ||
protected ArrayList<Button> myButtons; | ||
protected double speed; | ||
protected double numCells; | ||
protected double cellSize; | ||
private ArrayList<Button> buttons; | ||
|
||
protected List<Button> buttons; | ||
private List<String> buttonNames = new ArrayList<String>(Arrays.asList("Start", "Step")); | ||
|
||
protected boolean windowOpen = false; | ||
protected boolean simulationRunning = false; | ||
|
||
private static final int FRAMES_PER_SECOND = 60; | ||
private static final int MILLISECOND_DELAY = 1000 / FRAMES_PER_SECOND; | ||
private static final double SECOND_DELAY = 1.0 / FRAMES_PER_SECOND; | ||
|
||
|
||
public SimulationWindow() { | ||
super(); | ||
setupScene(); | ||
userInteraction(); | ||
|
||
// attach "game loop" to timeline to play it | ||
KeyFrame frame = new KeyFrame(Duration.millis(MILLISECOND_DELAY), | ||
e -> step(SECOND_DELAY)); | ||
Timeline animation = new Timeline(); | ||
animation.setCycleCount(Timeline.INDEFINITE); | ||
animation.getKeyFrames().add(frame); | ||
animation.play(); | ||
} | ||
|
||
|
||
private void userInteraction() { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
/** | ||
* Updates the cells for each SimulationWindow | ||
*/ | ||
public void step(double elapsedTime) { | ||
// do nothing | ||
} | ||
|
||
@Override | ||
public void setupScene() { | ||
buttons = new ArrayList<Button>(); | ||
addButtons(); | ||
addTitle(); | ||
} | ||
|
||
private void addButtons() { | ||
|
||
//TODO | ||
} | ||
|
||
private void addTitle() { | ||
//TODO | ||
} | ||
|
||
private void addSlider() { | ||
|
||
} | ||
|
||
public GridPane addGridPane() { //https://stackoverflow.com/questions/35367060/gridpane-of-squares-in-javafx | ||
GridPane grid = new GridPane(); | ||
for (int row = 0; row < numCells; row++) { | ||
for (int col = 0; col < numCells; col++) { | ||
Rectangle rect = new Rectangle(); | ||
rect.setWidth(cellSize); | ||
rect.setHeight(cellSize); | ||
GridPane.setRowIndex(rect, row); | ||
GridPane.setColumnIndex(rect, col); | ||
grid.getChildren().add(rect); | ||
} | ||
} | ||
myRoot.getChildren().add(grid); | ||
return grid; | ||
GridPane grid = new GridPane(); | ||
for (int row = 0; row < numCells; row++) { | ||
for (int col = 0; col < numCells; col++) { | ||
Rectangle rect = new Rectangle(); | ||
rect.setWidth(cellSize); | ||
rect.setHeight(cellSize); | ||
GridPane.setRowIndex(rect, row); | ||
GridPane.setColumnIndex(rect, col); | ||
grid.getChildren().add(rect); | ||
} | ||
} | ||
myRoot.getChildren().add(grid); | ||
return grid; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package cellsociety_team04; | ||
|
||
public class WatorWindow extends Window { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters