Loading src/main/java/org/example/newmat/GraphicsAndWindowsTest.java +21 −3 Original line number Diff line number Diff line Loading @@ -103,9 +103,26 @@ public class GraphicsAndWindowsTest extends Application { String[] ob3 = {"--image", figure3, "--speed", "5", "--dir", "1,", "1,", "1"}; //String[] ob4 = {"--image", "src/teapot.txt", "--speed", "100", "--dir", "3,", "5,", "7"}; //MovingObject newObject1 = new MovingObject(arguments); MovingObject newObject1 = new MovingObject(ob1); MovingObject newObject2 = new MovingObject(ob2); MovingObject newObject3 = new MovingObject(ob3); MovingObject newObject1; if(figure1.equals("Use CL")){ newObject1 = new MovingObject(arguments); } else{ newObject1 = new MovingObject(ob1); } MovingObject newObject2; if(figure2.equals("Use CL")){ newObject2 = new MovingObject(arguments); } else{ newObject2 = new MovingObject(ob2); } MovingObject newObject3; if(figure3.equals("Use CL")){ newObject3 = new MovingObject(arguments); } else{ newObject3 = new MovingObject(ob3); } // MovingObject newObject2 = new MovingObject(ob2); // MovingObject newObject3 = new MovingObject(ob3); //MovingObject newObject4 = new MovingObject(ob4); objects = new MovingObject[3]; objects[0] = newObject1; Loading Loading @@ -495,3 +512,4 @@ public class GraphicsAndWindowsTest extends Application { } } src/main/java/org/example/newmat/MainScene.java +41 −5 Original line number Diff line number Diff line Loading @@ -29,6 +29,23 @@ public class MainScene extends Application { private Scene createMenuScene(Stage stage) { //LABELS FOR FIGURE SELECTION Label fig1Label = new Label("Figure 1"); fig1Label.setPrefWidth(100); fig1Label.setAlignment(Pos.CENTER); fig1Label.getStyleClass().add("check-button"); Label fig2Label = new Label("Figure 2"); fig2Label.setPrefWidth(150); fig2Label.setAlignment(Pos.CENTER); fig2Label.getStyleClass().add("check-button"); Label fig3Label = new Label("Figure 3"); fig3Label.setPrefWidth(100); fig3Label.setAlignment(Pos.CENTER); fig3Label.getStyleClass().add("check-button"); HBox figHBox = new HBox(10); // 10 is the spacing between groups figHBox.getChildren().addAll(fig1Label, fig2Label, fig3Label); figHBox.setAlignment(Pos.CENTER); //FOR FIGURE SELECTION // First group of radio buttons ToggleGroup group1 = new ToggleGroup(); Loading @@ -41,7 +58,13 @@ public class MainScene extends Application { RadioButton fig1sphere = new RadioButton("Sphere"); fig1sphere.getStyleClass().add("check-button"); fig1sphere.setToggleGroup(group1); VBox fig1Box = new VBox(fig1Arma, fig1teapot, fig1sphere); RadioButton fig1CL = new RadioButton("Command Line"); fig1CL.getStyleClass().add("check-button"); fig1CL.setToggleGroup(group1); RadioButton fig1None = new RadioButton("None"); fig1None.getStyleClass().add("check-button"); fig1None.setToggleGroup(group1); VBox fig1Box = new VBox(fig1Arma, fig1teapot, fig1sphere, fig1CL, fig1None); // Second group of radio buttons ToggleGroup group2 = new ToggleGroup(); Loading @@ -54,7 +77,13 @@ public class MainScene extends Application { RadioButton fig2sphere = new RadioButton("Sphere"); fig2sphere.getStyleClass().add("check-button"); fig2sphere.setToggleGroup(group2); VBox fig2Box = new VBox(fig2Arma, fig2teapot, fig2sphere); RadioButton fig2CL = new RadioButton("Command Line"); fig2CL.getStyleClass().add("check-button"); fig2CL.setToggleGroup(group2); RadioButton fig2None = new RadioButton("None"); fig2None.getStyleClass().add("check-button"); fig2None.setToggleGroup(group2); VBox fig2Box = new VBox(fig2Arma, fig2teapot, fig2sphere, fig2CL, fig2None); // Third group of radio buttons ToggleGroup group3 = new ToggleGroup(); Loading @@ -67,7 +96,13 @@ public class MainScene extends Application { RadioButton fig3sphere = new RadioButton("Sphere"); fig3sphere.getStyleClass().add("check-button"); fig3sphere.setToggleGroup(group3); VBox fig3Box = new VBox(fig3Arma, fig3teapot, fig3sphere); RadioButton fig3CL = new RadioButton("Command Line"); fig3CL.getStyleClass().add("check-button"); fig3CL.setToggleGroup(group3); RadioButton fig3None = new RadioButton("None"); fig3None.getStyleClass().add("check-button"); fig3None.setToggleGroup(group3); VBox fig3Box = new VBox(fig3Arma, fig3teapot, fig3sphere, fig3CL, fig3None); // Adding listeners to each group group1.selectedToggleProperty().addListener((observable, oldValue, newValue) -> { Loading Loading @@ -136,9 +171,10 @@ public class MainScene extends Application { } }); //PARENT OF ALL THE LAYOUTS VBox menuLayout = new VBox(10); menuLayout.setAlignment(Pos.CENTER); menuLayout.getChildren().addAll(startButton, selector, normObsText, menuLayout.getChildren().addAll(startButton, figHBox,selector, normObsText, normalObstInt, gameObsText, gameObstInt); Scene menuScene = new Scene(menuLayout, 1500, 800); Loading @@ -157,7 +193,7 @@ public class MainScene extends Application { case "Teapot" -> "src/teapot.txt"; case "Sphere" -> "src/sphereOut.txt"; case "None" -> "none"; case "Command Line" -> "Use command line"; case "Command Line" -> "Use CL"; default -> "nothing picked"; }; } Loading src/main/resources/MainMenu.css +2 −2 Original line number Diff line number Diff line Loading @@ -6,8 +6,8 @@ } .check-button { -fx-background-color: #ffffff ; /* Topaz */ -fx-text-fill: yellow; -fx-background-color: #D70040 ; /* Topaz */ -fx-text-fill: white; -fx-font-size: 14px; -fx-padding: 10; } Loading Loading
src/main/java/org/example/newmat/GraphicsAndWindowsTest.java +21 −3 Original line number Diff line number Diff line Loading @@ -103,9 +103,26 @@ public class GraphicsAndWindowsTest extends Application { String[] ob3 = {"--image", figure3, "--speed", "5", "--dir", "1,", "1,", "1"}; //String[] ob4 = {"--image", "src/teapot.txt", "--speed", "100", "--dir", "3,", "5,", "7"}; //MovingObject newObject1 = new MovingObject(arguments); MovingObject newObject1 = new MovingObject(ob1); MovingObject newObject2 = new MovingObject(ob2); MovingObject newObject3 = new MovingObject(ob3); MovingObject newObject1; if(figure1.equals("Use CL")){ newObject1 = new MovingObject(arguments); } else{ newObject1 = new MovingObject(ob1); } MovingObject newObject2; if(figure2.equals("Use CL")){ newObject2 = new MovingObject(arguments); } else{ newObject2 = new MovingObject(ob2); } MovingObject newObject3; if(figure3.equals("Use CL")){ newObject3 = new MovingObject(arguments); } else{ newObject3 = new MovingObject(ob3); } // MovingObject newObject2 = new MovingObject(ob2); // MovingObject newObject3 = new MovingObject(ob3); //MovingObject newObject4 = new MovingObject(ob4); objects = new MovingObject[3]; objects[0] = newObject1; Loading Loading @@ -495,3 +512,4 @@ public class GraphicsAndWindowsTest extends Application { } }
src/main/java/org/example/newmat/MainScene.java +41 −5 Original line number Diff line number Diff line Loading @@ -29,6 +29,23 @@ public class MainScene extends Application { private Scene createMenuScene(Stage stage) { //LABELS FOR FIGURE SELECTION Label fig1Label = new Label("Figure 1"); fig1Label.setPrefWidth(100); fig1Label.setAlignment(Pos.CENTER); fig1Label.getStyleClass().add("check-button"); Label fig2Label = new Label("Figure 2"); fig2Label.setPrefWidth(150); fig2Label.setAlignment(Pos.CENTER); fig2Label.getStyleClass().add("check-button"); Label fig3Label = new Label("Figure 3"); fig3Label.setPrefWidth(100); fig3Label.setAlignment(Pos.CENTER); fig3Label.getStyleClass().add("check-button"); HBox figHBox = new HBox(10); // 10 is the spacing between groups figHBox.getChildren().addAll(fig1Label, fig2Label, fig3Label); figHBox.setAlignment(Pos.CENTER); //FOR FIGURE SELECTION // First group of radio buttons ToggleGroup group1 = new ToggleGroup(); Loading @@ -41,7 +58,13 @@ public class MainScene extends Application { RadioButton fig1sphere = new RadioButton("Sphere"); fig1sphere.getStyleClass().add("check-button"); fig1sphere.setToggleGroup(group1); VBox fig1Box = new VBox(fig1Arma, fig1teapot, fig1sphere); RadioButton fig1CL = new RadioButton("Command Line"); fig1CL.getStyleClass().add("check-button"); fig1CL.setToggleGroup(group1); RadioButton fig1None = new RadioButton("None"); fig1None.getStyleClass().add("check-button"); fig1None.setToggleGroup(group1); VBox fig1Box = new VBox(fig1Arma, fig1teapot, fig1sphere, fig1CL, fig1None); // Second group of radio buttons ToggleGroup group2 = new ToggleGroup(); Loading @@ -54,7 +77,13 @@ public class MainScene extends Application { RadioButton fig2sphere = new RadioButton("Sphere"); fig2sphere.getStyleClass().add("check-button"); fig2sphere.setToggleGroup(group2); VBox fig2Box = new VBox(fig2Arma, fig2teapot, fig2sphere); RadioButton fig2CL = new RadioButton("Command Line"); fig2CL.getStyleClass().add("check-button"); fig2CL.setToggleGroup(group2); RadioButton fig2None = new RadioButton("None"); fig2None.getStyleClass().add("check-button"); fig2None.setToggleGroup(group2); VBox fig2Box = new VBox(fig2Arma, fig2teapot, fig2sphere, fig2CL, fig2None); // Third group of radio buttons ToggleGroup group3 = new ToggleGroup(); Loading @@ -67,7 +96,13 @@ public class MainScene extends Application { RadioButton fig3sphere = new RadioButton("Sphere"); fig3sphere.getStyleClass().add("check-button"); fig3sphere.setToggleGroup(group3); VBox fig3Box = new VBox(fig3Arma, fig3teapot, fig3sphere); RadioButton fig3CL = new RadioButton("Command Line"); fig3CL.getStyleClass().add("check-button"); fig3CL.setToggleGroup(group3); RadioButton fig3None = new RadioButton("None"); fig3None.getStyleClass().add("check-button"); fig3None.setToggleGroup(group3); VBox fig3Box = new VBox(fig3Arma, fig3teapot, fig3sphere, fig3CL, fig3None); // Adding listeners to each group group1.selectedToggleProperty().addListener((observable, oldValue, newValue) -> { Loading Loading @@ -136,9 +171,10 @@ public class MainScene extends Application { } }); //PARENT OF ALL THE LAYOUTS VBox menuLayout = new VBox(10); menuLayout.setAlignment(Pos.CENTER); menuLayout.getChildren().addAll(startButton, selector, normObsText, menuLayout.getChildren().addAll(startButton, figHBox,selector, normObsText, normalObstInt, gameObsText, gameObstInt); Scene menuScene = new Scene(menuLayout, 1500, 800); Loading @@ -157,7 +193,7 @@ public class MainScene extends Application { case "Teapot" -> "src/teapot.txt"; case "Sphere" -> "src/sphereOut.txt"; case "None" -> "none"; case "Command Line" -> "Use command line"; case "Command Line" -> "Use CL"; default -> "nothing picked"; }; } Loading
src/main/resources/MainMenu.css +2 −2 Original line number Diff line number Diff line Loading @@ -6,8 +6,8 @@ } .check-button { -fx-background-color: #ffffff ; /* Topaz */ -fx-text-fill: yellow; -fx-background-color: #D70040 ; /* Topaz */ -fx-text-fill: white; -fx-font-size: 14px; -fx-padding: 10; } Loading