<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.DatePicker?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.SplitPane?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.FlowPane?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Text?>

<AnchorPane fx:id="basePane" prefHeight="600.0" prefWidth="736.0" xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1" fx:controller="controllers.PastResultsController">
   <children>
      <VBox prefHeight="600.0" prefWidth="736.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
         <children>
          <AnchorPane>
               <children>
                  <FlowPane maxHeight="30.0" minHeight="30.0" prefHeight="30.0" prefWidth="598.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
                     <children>
                        <DatePicker fx:id="date" prefHeight="30.0" prefWidth="209.0" />
            		    <ComboBox id="CountryComboBox" fx:id="countrySelector" onAction="#countrySelected" prefHeight="25.0" prefWidth="200.0" promptText="Country" />
                        <ComboBox id="LeagueComboBox" fx:id="leagueSelector" disable="true" onAction="#leagueSelected" prefHeight="25.0" prefWidth="200.0" promptText="League" />
                        <Button mnemonicParsing="false" onAction="#updateStatsTable" text="Update Statistics" />
                        <Button mnemonicParsing="false" onAction="#updateStandingsTable" text="Update standings table" />
                        <Button mnemonicParsing="false" onAction="#getAllMatchesAtDate" text="Get all matches for date" />
                     </children>
                  </FlowPane>
               </children>
            </AnchorPane>
          <AnchorPane VBox.vgrow="ALWAYS">
               <children>
               	   <TableView fx:id="matchTable" prefHeight="546.0" prefWidth="893.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
				     <columns>
				       <TableColumn fx:id="gameDateColumn" editable="false" prefWidth="75.0" text="Game date" />
				       <TableColumn fx:id="homeTeamColumn" editable="false" prefWidth="75.0" text="Home team" />
				       <TableColumn fx:id="awayTeamColumn" prefWidth="75.0" text="Away team" />
				       <TableColumn fx:id="odds1Column" prefWidth="75.0" text="Odds 1" />
				       <TableColumn fx:id="oddsXColumn" prefWidth="75.0" text="Odds X" />
				       <TableColumn fx:id="odds2Column" prefWidth="75.0" text="Odds 2" />
				       <TableColumn fx:id="goalsHomeColumn" prefWidth="75.0" text="Goals home" />
				       <TableColumn fx:id="goalsAwayColumn" prefWidth="75.0" text="Goals away" />
				       <TableColumn fx:id="goalDiff" prefWidth="75.0" text="Difference" />
				       <TableColumn fx:id="avgScoreHomeColumn" prefWidth="75.0" text="Avg score home" />
				       <TableColumn fx:id="avgConcededHomeColumn" prefWidth="75.0" text="Avg conceded home" />
				       <TableColumn fx:id="avgScoreAwayColumn" prefWidth="75.0" text="Avg score away" />
				       <TableColumn fx:id="avgConcededAwayColumn" prefWidth="75.0" text="Avg conceded away" />
				       <TableColumn fx:id="avgHomeScoredSeason" prefWidth="75.0" text="HomeScoredSeason" />
				       <TableColumn fx:id="avgHomeConcededSeason" prefWidth="75.0" text="HomeConcededSeason" />
				       <TableColumn fx:id="avgAwayScoredSeason" prefWidth="75.0" text="AwayScoredSeason" />
				       <TableColumn fx:id="avgAwayConcededSeason" prefWidth="75.0" text="AwayConcededSeason" />
				       <TableColumn fx:id="sumScoringColumn" prefWidth="75.0" text="Sum scoring" />
				       <TableColumn fx:id="positionAdjustmentColumn" prefWidth="75.0" text="Position Adjustments" />
				       <TableColumn fx:id="newScoringTestColumn" prefWidth="75.0" text="New scoring test" />
				       <TableColumn fx:id="addToBetsButtonColumn" prefWidth="75.0" text="Add bet" />
                       <TableColumn fx:id="analysisColumn" prefWidth="75.0" text="Analysis" />
				     </columns>
				   </TableView>
               </children>
            </AnchorPane>
            <AnchorPane minHeight="200.0" minWidth="200.0">
               <children>
                  <SplitPane dividerPositions="0.5" prefHeight="100.0" prefWidth="736.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
                     <items>
                        <GridPane prefHeight="100.0" prefWidth="736.0">
                          <columnConstraints>
                            <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
                            <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
                          </columnConstraints>
                          <rowConstraints>
                            <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
                            <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
                            <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
                              <RowConstraints />
                          </rowConstraints>
                           <children>
                              <Text strokeType="OUTSIDE" strokeWidth="0.0" text="Past results homeTeam" />
                              <Text strokeType="OUTSIDE" strokeWidth="0.0" text="Past results awayTeam" GridPane.rowIndex="1" />
                              <Text strokeType="OUTSIDE" strokeWidth="0.0" text="Past meeting results" GridPane.rowIndex="2" />
                              <Text strokeType="OUTSIDE" strokeWidth="0.0" text="Past reverse meeting results" GridPane.rowIndex="3" />
                              <Text fx:id="homeTeamPastResultsText" strokeType="OUTSIDE" strokeWidth="0.0" text="Placeholder homeTeam" GridPane.columnIndex="1" />
                              <Text fx:id="awayTeamPastResultsText" strokeType="OUTSIDE" strokeWidth="0.0" text="Placeholder awayTeam" GridPane.columnIndex="1" GridPane.rowIndex="1" />
                              <Text fx:id="previousMeetingsText" strokeType="OUTSIDE" strokeWidth="0.0" text="Placeholder meets" GridPane.columnIndex="1" GridPane.rowIndex="2" />
                              <Text fx:id="previousReverseMeetingsText" strokeType="OUTSIDE" strokeWidth="0.0" text="Placeholder Reverse meets" GridPane.columnIndex="1" GridPane.rowIndex="3" />
                           </children>
                           <opaqueInsets>
                              <Insets />
                           </opaqueInsets>
                        </GridPane>
                        <SplitPane dividerPositions="0.75" orientation="VERTICAL" prefHeight="200.0" prefWidth="160.0">
                          <items>
                            <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="100.0" prefWidth="160.0">
                                 <children>
                                    <GridPane prefHeight="71.0" prefWidth="364.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
                                      <columnConstraints>
                                        <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
                                        <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
                                      </columnConstraints>
                                      <rowConstraints>
                                        <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
                                        <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
                                        <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
                                          <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
                                      </rowConstraints>
                                       <children>
                                          <Label text="Number of games" />
                                          <Label fx:id="NumberOfGamesText" text="0" GridPane.columnIndex="1" />
                                          <Label text="Systems" GridPane.rowIndex="1" GridPane.rowSpan="2" />
                                          <TextArea fx:id="SystemsText" text="" GridPane.columnIndex="1" GridPane.rowIndex="1" GridPane.rowSpan="2" />
                                          <Label prefHeight="17.0" prefWidth="36.0" text="Result" GridPane.rowIndex="3" />
                                          <Label fx:id="ReslutsText" text="" GridPane.columnIndex="1" GridPane.rowIndex="3" />
                                       </children>
                                    </GridPane>
                                 </children>
                              </AnchorPane>
                            <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="100.0" prefWidth="160.0">
                                 <children>
                                    <Button mnemonicParsing="false" onAction="#CheckBetSlip" text="Rätta" />
                                    <Button layoutX="312.0" layoutY="-2.0" mnemonicParsing="false" onAction="#ClearBetSlip" text="Rensa" />
                                 </children>
                              </AnchorPane>
                          </items>
                        </SplitPane>
                     </items>
                  </SplitPane>
               </children>
            </AnchorPane>
         </children>
      </VBox>
   </children>
</AnchorPane>
