Users can now view trips and trips now have a name field

This commit is contained in:
Fan-Wu Yang
2017-05-24 17:16:32 +12:00
parent caed3e64b3
commit 8abe49ab15
17 changed files with 402 additions and 56 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+18 -11
View File
@@ -17,7 +17,8 @@
<rowConstraints>
<RowConstraints maxHeight="50.0" minHeight="50.0" prefHeight="50.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="40.0" minHeight="40.0" prefHeight="40.0" vgrow="SOMETIMES" />
<RowConstraints prefHeight="40.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="40.0" prefHeight="40.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="40.0" prefHeight="40.0" vgrow="SOMETIMES" />
<RowConstraints prefHeight="348.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="40.0" prefHeight="40.0" vgrow="SOMETIMES" />
</rowConstraints>
@@ -27,18 +28,18 @@
<Font size="18.0" />
</font>
</Label>
<Label text="Select Route:" GridPane.halignment="CENTER" GridPane.rowIndex="1">
<Label text="Select Route:" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="1">
<font>
<Font size="16.0" />
</font>
</Label>
<Label text="Select Weekday for Trip" GridPane.columnIndex="2" GridPane.columnSpan="2" GridPane.halignment="CENTER" GridPane.rowIndex="2">
<Label text="Select Weekday for Trip" GridPane.columnIndex="2" GridPane.columnSpan="2" GridPane.halignment="CENTER" GridPane.rowIndex="3">
<font>
<Font size="16.0" />
</font>
</Label>
<ComboBox fx:id="routeDropdown" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TableView fx:id="routeTable" editable="true" prefHeight="200.0" prefWidth="200.0" GridPane.columnSpan="2" GridPane.rowIndex="3">
<ComboBox fx:id="routeDropdown" prefWidth="150.0" GridPane.columnIndex="3" GridPane.rowIndex="1" />
<TableView fx:id="routeTable" editable="true" prefHeight="200.0" prefWidth="200.0" GridPane.columnSpan="2" GridPane.rowIndex="3" GridPane.rowSpan="2">
<columns>
<TableColumn fx:id="stopName" editable="false" maxWidth="-1.0" minWidth="150.0" prefWidth="150.0" resizable="false" text="Stop" />
<TableColumn fx:id="stopTime" maxWidth="-1.0" minWidth="150.0" prefWidth="150.0" resizable="false" text="Time" />
@@ -47,7 +48,7 @@
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
</columnResizePolicy>
</TableView>
<GridPane GridPane.columnIndex="2" GridPane.columnSpan="2" GridPane.rowIndex="3">
<GridPane GridPane.columnIndex="2" GridPane.columnSpan="2" GridPane.rowIndex="4">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
@@ -74,19 +75,25 @@
<ComboBox fx:id="reoccur" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="4" />
</children>
</GridPane>
<Label text="Select Direction:" GridPane.halignment="CENTER" GridPane.rowIndex="2">
<Label text="Select Direction:" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="2">
<font>
<Font size="16.0" />
</font>
</Label>
<ComboBox fx:id="direction" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Button mnemonicParsing="false" onAction="#addTrip" prefHeight="25.0" prefWidth="391.0" text="Add Trip" GridPane.columnSpan="4" GridPane.halignment="CENTER" GridPane.rowIndex="4" />
<Label text="Select Car:" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="1">
<ComboBox fx:id="direction" prefWidth="150.0" GridPane.columnIndex="3" GridPane.rowIndex="2" />
<Button mnemonicParsing="false" onAction="#addTrip" prefHeight="25.0" prefWidth="391.0" text="Add Trip" GridPane.columnSpan="4" GridPane.halignment="CENTER" GridPane.rowIndex="5" />
<Label text="Select Car:" GridPane.halignment="CENTER" GridPane.rowIndex="2">
<font>
<Font size="16.0" />
</font>
</Label>
<ComboBox fx:id="ride" prefWidth="150.0" GridPane.columnIndex="3" GridPane.rowIndex="1" />
<ComboBox fx:id="ride" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label text="Trip Name:" GridPane.halignment="CENTER" GridPane.rowIndex="1" GridPane.valignment="CENTER">
<font>
<Font size="16.0" />
</font>
</Label>
<TextField fx:id="tripName" GridPane.columnIndex="1" GridPane.rowIndex="1" />
</children>
</GridPane>
</children>
+5
View File
@@ -46,6 +46,11 @@
<Button mnemonicParsing="false" onAction="#myRoutes" text="Routes" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" />
</children>
</AnchorPane>
<AnchorPane>
<children>
<Button mnemonicParsing="false" onAction="#myTrips" text="Trips" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" />
</children>
</AnchorPane>
</children>
</VBox>
</children>
+112
View File
@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.*?>
<?import javafx.scene.text.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="controllers.MyTripsController">
<children>
<GridPane layoutX="213.0" layoutY="99.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="300.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="300.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="300.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="50.0" minHeight="50.0" prefHeight="50.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="40.0" minHeight="40.0" prefHeight="40.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="348.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<ListView fx:id="tripsList" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="2" />
<Label text="My Trips" GridPane.columnSpan="3" GridPane.halignment="CENTER">
<font>
<Font size="18.0" />
</font>
</Label>
<Label text="Trips" GridPane.halignment="CENTER" GridPane.rowIndex="1">
<font>
<Font size="16.0" />
</font>
</Label>
<Label text="Stops" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="1">
<font>
<Font size="16.0" />
</font>
</Label>
<TableView fx:id="stopsList" prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="2">
<columns>
<TableColumn prefWidth="104.0" text="Time" />
<TableColumn prefWidth="95.0" text="Stop" />
</columns>
</TableView>
<Label text="Information" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="1">
<font>
<Font size="16.0" />
</font>
</Label>
<GridPane GridPane.columnIndex="2" GridPane.rowIndex="2">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="80.0" minWidth="10.0" prefWidth="80.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 minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="Ride:" />
<Label fx:id="rideLabel" text="Label" GridPane.columnIndex="1" />
<Label text="Direction:" GridPane.rowIndex="1" />
<Label fx:id="directionLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label text="Days:" GridPane.rowIndex="2" />
<Label text="Reoccuring:" GridPane.rowIndex="3" />
<Label text="Trip End Date:" GridPane.rowIndex="4" />
<Label fx:id="reoccuringLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<Label fx:id="endDateLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="4" />
<HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="2" GridPane.valignment="CENTER">
<children>
<Label fx:id="mondayLabel" style="-fx-border-color: #F0F0F0; -fx-border-width: 1;" text="M" AnchorPane.bottomAnchor="23.0" AnchorPane.topAnchor="22.0">
<HBox.margin>
<Insets />
</HBox.margin>
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
</Label>
<Label fx:id="tuesdayLabel" style="-fx-border-color: #F0F0F0; -fx-border-width: 1;" text="T">
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
</Label>
<Label fx:id="wednesdayLabel" style="-fx-border-color: #F0F0F0; -fx-border-width: 1;" text="W">
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
</Label>
<Label fx:id="thursdayLabel" style="-fx-border-color: #F0F0F0; -fx-border-width: 1;" text="T">
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
</Label>
<Label fx:id="fridayLabel" style="-fx-border-color: #F0F0F0; -fx-border-width: 1;" text="F">
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
</Label>
</children>
</HBox>
</children>
<GridPane.margin>
<Insets left="10.0" />
</GridPane.margin>
</GridPane>
</children>
</GridPane>
</children>
</AnchorPane>
+1 -1
View File
@@ -1 +1 @@
[{"serialisedRoute":[{"serialiseTime":"3:00","serialiseName":"1 University Drive"},{"serialiseTime":"3:10","serialiseName":"1 Homestead Lane"}],"direction":"Home","ride":{"model":"Nissan March","colour":"Baby Blue","licensePlate":"H19405661","year":2004,"numSeats":4},"days":[true,false,false,false,false,false,false],"reoccur":false,"endDate":""}]
[{"serialisedRoute":[{"serialiseTime":"3:00","serialiseName":"1 University Drive"},{"serialiseTime":"3:10","serialiseName":"1 Homestead Lane"}],"direction":"Home","ride":{"model":"Nissan March","colour":"Baby Blue","licensePlate":"H19405661","year":2004,"numSeats":4},"days":[true,false,false,false,false,false,false],"reoccur":false,"endDate":"","name":"University to Home"}]