From 12edffe1657c39fb895981280b028131d633b007 Mon Sep 17 00:00:00 2001 From: Keturah Edwards <33634413+Turah09@users.noreply.github.com> Date: Sat, 18 Apr 2020 12:17:43 -0400 Subject: [PATCH 1/2] Fix the program to actually run. toke off all the bug that was causing it to crash --- src/wrestlingtournamentcli/Main.java | 67 +++++++++++++--------------- 1 file changed, 30 insertions(+), 37 deletions(-) diff --git a/src/wrestlingtournamentcli/Main.java b/src/wrestlingtournamentcli/Main.java index 2719775..497c873 100644 --- a/src/wrestlingtournamentcli/Main.java +++ b/src/wrestlingtournamentcli/Main.java @@ -41,31 +41,31 @@ public static void main(String[] args) { System.out.println("Please enter the sport you would like to manage(wrestling/soccer/race/bowling):\n Note: Enter 'QUIT' at anytime to end the program."); while(true) { - String sportSelection = s.nextLine(); - switch(sportSelection.toLowerCase()) { - case "wrestling": - Model wrestlerModel = new Model("wrestling"); - wrestlingMenu(); - break; - case "race": - Race race = new Race(); - raceMenu(); - break; - case "bowling": - Bowling bowling = new Bowling(); - bowlingMenu(); - break; - case "soccer": - Model soccerModel = new Model("soccer"); - soccerMenu(); - break; - case "quit": - exitProgram(); - break; - default: - System.out.println("Incorrect input. Please enter wrestling/soccer/race/bowling"); + String sportSelection = s.nextLine(); + switch(sportSelection.toLowerCase()) { + case "wrestling": + Model wrestlerModel = new Model("wrestling"); + wrestlingMenu(); + break; + case "race": + Race race = new Race(); + raceMenu(); + break; + case "bowling": + Bowling bowling = new Bowling(); + bowlingMenu(); + break; + case "soccer": + Model soccerModel = new Model("soccer"); + soccerMenu(); + break; + case "quit": + exitProgram(); + break; + default: + System.out.println("Incorrect input. Please enter wrestling/soccer/race/bowling"); } - } + } } public static void raceMenu(){ @@ -450,7 +450,7 @@ public void start(Stage stage) throws Exception { Button compareWrestlers = new Button(); - TextField compareWrestlersTxt = new TextField(); + TextField compareWrestlersTxt = new TextField(); TextField saveTournament = new TextField(); TextField FirstName = new TextField(); TextField LastName = new TextField(); @@ -464,7 +464,7 @@ public void start(Stage stage) throws Exception { compareWrestlers.setText("Compare Wrestlers"); compareWrestlersTxt.setText("Name,Name"); ListView compareWrestlerView = new ListView(); - Button wrestlerBack = new Button(); + Button wrestlerBack = new Button(); ListView startView = new ListView(); //button declarations i've added Button advance = new Button(); @@ -473,8 +473,6 @@ public void start(Stage stage) throws Exception { - - // adds tooltips to each menu button Tooltip viewTeamsTooltip = new Tooltip("Displays the imported teams in the display box to the right"); Tooltip.install(viewTeams, viewTeamsTooltip); @@ -612,9 +610,7 @@ public void start(Stage stage) throws Exception { layout.add(Weight, 1, 10); layout.add(TotalWins, 1,11); layout.add(TotalMatch, 1, 12); - layout.add(start, 0, 6); - - + layout.add(compareWrestlers, 0, 7); layout.add( compareWrestlersTxt, 1, 7); @@ -644,11 +640,7 @@ public void start(Stage stage) throws Exception { }); viewTeams.setOnAction(e -> { - - - - viewTeams.setOnAction(e -> { - + ArrayList show = Model.printTeams(); for(int i = 0; i < show.size(); i++) { listView.getItems().add(show.get(i)); @@ -1061,5 +1053,6 @@ else if (check == 2) { stage.setScene(introScene); stage.show(); + } -} +}; From 00bdcd0a500dc71f66eeba0aede913f4bc32d479 Mon Sep 17 00:00:00 2001 From: Keturah Edwards <33634413+Turah09@users.noreply.github.com> Date: Sat, 18 Apr 2020 13:02:23 -0400 Subject: [PATCH 2/2] Fixed the bug and error on this file. --- src/wrestlingtournamentcli/Main.java | 34 ++++++++++++++++------------ 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/src/wrestlingtournamentcli/Main.java b/src/wrestlingtournamentcli/Main.java index 497c873..049768a 100644 --- a/src/wrestlingtournamentcli/Main.java +++ b/src/wrestlingtournamentcli/Main.java @@ -25,6 +25,11 @@ import javafx.stage.FileChooser; import javafx.stage.Stage; import javafx.scene.control.Tooltip; +import javafx.scene.text.Text; +import javafx.scene.text.TextAlignment; +import javafx.scene.paint.Color; +import javafx.scene.text.Font; +import javafx.scene.layout.StackPane; /** * @author Jared Murphy * @author Cody Francis @@ -38,8 +43,6 @@ public static void main(String[] args) { log.createLogFiles(); launch(args); - System.out.println("Please enter the sport you would like to manage(wrestling/soccer/race/bowling):\n Note: Enter 'QUIT' at anytime to end the program."); - while(true) { String sportSelection = s.nextLine(); switch(sportSelection.toLowerCase()) { @@ -436,7 +439,7 @@ public static void exitProgram() { @Override public void start(Stage stage) throws Exception { - stage.setTitle("RaiderSMA"); + BorderPane root = new BorderPane(); VBox mainMenu = new VBox(); VBox viewList = new VBox(); @@ -504,7 +507,7 @@ public void start(Stage stage) throws Exception { GridPane introLayout = new GridPane(); Button wrestling = new Button(); Button soccer = new Button(); - Label introMenu = new Label("Please select the sport you would like to manage:"); + //UI elements for selection Screen BorderPane soccerRoot = new BorderPane(); @@ -543,15 +546,23 @@ public void start(Stage stage) throws Exception { soccerRoot.setLeft(soccerMenu); soccerRoot.setCenter(soccerViewList); //Creating soccer scene + introLayout.setHgap(10); + introLayout.setVgap(12); wrestling.setText("Wrestling"); wrestling.setPadding(new Insets(10,10,10,10)); soccer.setText("Soccer"); soccer.setPadding(new Insets(10,10,10,10)); - introLayout.setPadding(new Insets(300,100,100,100)); - introLayout.add(introMenu, 0, 0); - introLayout.add(wrestling, 2,3 ); - introLayout.add(soccer, 3, 3); - introRoot.setCenter(introLayout); + //Intro Layout + Text intro = new Text ("Please select the sport you would like to manage"); + intro.setFont(new Font(20)); + intro.setFill(Color.DARKGREEN); + intro.setTextAlignment(TextAlignment.CENTER); + stage.setTitle("RaiderSMA"); + introLayout.setPadding(new Insets(250,100,100,100)); + introLayout.add(intro, 0, 0); + introLayout.add(wrestling, 0, 4); + introLayout.add(soccer,1,4); + introRoot.setCenter(introLayout); //Initializing introduction UI elements importTeams.setMinWidth(110); @@ -610,12 +621,8 @@ public void start(Stage stage) throws Exception { layout.add(Weight, 1, 10); layout.add(TotalWins, 1,11); layout.add(TotalMatch, 1, 12); - layout.add(compareWrestlers, 0, 7); layout.add( compareWrestlersTxt, 1, 7); - - - layout.add(advance, 0, 9); layout.add(help, 0, 10); layout.add(update, 0, 11); @@ -970,7 +977,6 @@ else if (check == 2) { Label rpLabel = new Label("Red Points"); Label ftyLabel = new Label("Fall Type"); Label ftiLabel = new Label("Fall Time"); - colorField.setMinWidth(110); greenPts.setMinWidth(110); redPts.setMinWidth(110);