Users can now view trips and trips now have a name field
This commit is contained in:
@@ -25,35 +25,37 @@ import java.util.ResourceBundle;
|
|||||||
public class AddTripController extends Controller{
|
public class AddTripController extends Controller{
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
ComboBox<Route> routeDropdown;
|
private ComboBox<Route> routeDropdown;
|
||||||
@FXML
|
@FXML
|
||||||
ComboBox<Ride> ride;
|
private ComboBox<Ride> ride;
|
||||||
@FXML
|
@FXML
|
||||||
ComboBox<String> direction;
|
private ComboBox<String> direction;
|
||||||
@FXML
|
@FXML
|
||||||
TableView<TripStop> routeTable;
|
private TableView<TripStop> routeTable;
|
||||||
@FXML
|
@FXML
|
||||||
TableColumn<TripStop, String> stopName;
|
private TableColumn<TripStop, String> stopName;
|
||||||
@FXML
|
@FXML
|
||||||
TableColumn<TripStop, String> stopTime;
|
private TableColumn<TripStop, String> stopTime;
|
||||||
@FXML
|
@FXML
|
||||||
CheckBox mon;
|
private CheckBox mon;
|
||||||
@FXML
|
@FXML
|
||||||
CheckBox tues;
|
private CheckBox tues;
|
||||||
@FXML
|
@FXML
|
||||||
CheckBox wed;
|
private CheckBox wed;
|
||||||
@FXML
|
@FXML
|
||||||
CheckBox thur;
|
private CheckBox thur;
|
||||||
@FXML
|
@FXML
|
||||||
CheckBox fri;
|
private CheckBox fri;
|
||||||
@FXML
|
@FXML
|
||||||
CheckBox sat;
|
private CheckBox sat;
|
||||||
@FXML
|
@FXML
|
||||||
CheckBox sun;
|
private CheckBox sun;
|
||||||
@FXML
|
@FXML
|
||||||
ComboBox<String> reoccur;
|
private ComboBox<String> reoccur;
|
||||||
@FXML
|
@FXML
|
||||||
DatePicker endDate;
|
private DatePicker endDate;
|
||||||
|
@FXML
|
||||||
|
private TextField tripName;
|
||||||
|
|
||||||
ObservableList<TripStop> stops;
|
ObservableList<TripStop> stops;
|
||||||
|
|
||||||
@@ -72,6 +74,11 @@ public class AddTripController extends Controller{
|
|||||||
failure += "You must select a ride (vehicle) for this trip.\n";
|
failure += "You must select a ride (vehicle) for this trip.\n";
|
||||||
fail = true;
|
fail = true;
|
||||||
}
|
}
|
||||||
|
if (tripName.getText() == null || tripName.getText() == ""){
|
||||||
|
failure += "You must name this Trip.\n";
|
||||||
|
fail = true;
|
||||||
|
}
|
||||||
|
|
||||||
for (TripStop stop: stops){
|
for (TripStop stop: stops){
|
||||||
if (stop.getTime().equals("")){
|
if (stop.getTime().equals("")){
|
||||||
failure += "You must have all times for stops filled out.\n";
|
failure += "You must have all times for stops filled out.\n";
|
||||||
@@ -85,7 +92,7 @@ public class AddTripController extends Controller{
|
|||||||
if (endDate.getValue() != null && boolReoccur == true){
|
if (endDate.getValue() != null && boolReoccur == true){
|
||||||
date = endDate.getValue().toString();
|
date = endDate.getValue().toString();
|
||||||
}
|
}
|
||||||
Trip trip = new Trip(stops, direction.getValue(), ride.getValue(), days, boolReoccur, date);
|
Trip trip = new Trip(tripName.getText() ,stops, direction.getValue(), ride.getValue(), days, boolReoccur, date);
|
||||||
System.out.println(trip);
|
System.out.println(trip);
|
||||||
Optional<ButtonType> result = popUp(Alert.AlertType.WARNING, "Warning!", "Crucial Information missing", failure, ButtonSets.YesNo);
|
Optional<ButtonType> result = popUp(Alert.AlertType.WARNING, "Warning!", "Crucial Information missing", failure, ButtonSets.YesNo);
|
||||||
parent.getSession().getDataManager().addTrip(trip);
|
parent.getSession().getDataManager().addTrip(trip);
|
||||||
|
|||||||
@@ -49,6 +49,10 @@ public class BaseController extends Controller {
|
|||||||
changeScene(SceneCode.ADD_TRIP);
|
changeScene(SceneCode.ADD_TRIP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void myTrips() throws Exception{
|
||||||
|
changeScene(SceneCode.MY_TRIPS);
|
||||||
|
}
|
||||||
|
|
||||||
public void setContent(Parent parent1){
|
public void setContent(Parent parent1){
|
||||||
//remove all children that do not belong to the original fxml
|
//remove all children that do not belong to the original fxml
|
||||||
while (base.getChildren().size() > childNum) {
|
while (base.getChildren().size() > childNum) {
|
||||||
|
|||||||
@@ -0,0 +1,86 @@
|
|||||||
|
package controllers;
|
||||||
|
|
||||||
|
import javafx.collections.ObservableList;
|
||||||
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.scene.control.Label;
|
||||||
|
import javafx.scene.control.ListView;
|
||||||
|
import javafx.scene.control.TableView;
|
||||||
|
import javafx.scene.layout.Background;
|
||||||
|
import javafx.scene.layout.BackgroundFill;
|
||||||
|
import javafx.scene.paint.Color;
|
||||||
|
import model.Trip;
|
||||||
|
import model.TripStop;
|
||||||
|
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Gondr on 24/05/2017.
|
||||||
|
*/
|
||||||
|
public class MyTripsController extends Controller{
|
||||||
|
@FXML
|
||||||
|
private Label rideLabel;
|
||||||
|
@FXML
|
||||||
|
private Label directionLabel;
|
||||||
|
@FXML
|
||||||
|
private Label mondayLabel;
|
||||||
|
@FXML
|
||||||
|
private Label tuesdayLabel;
|
||||||
|
@FXML
|
||||||
|
private Label wednesdayLabel;
|
||||||
|
@FXML
|
||||||
|
private Label thursdayLabel;
|
||||||
|
@FXML
|
||||||
|
private Label fridayLabel;
|
||||||
|
@FXML
|
||||||
|
private Label reoccuringLabel;
|
||||||
|
@FXML
|
||||||
|
private Label endDateLabel;
|
||||||
|
@FXML
|
||||||
|
private TableView<TripStop> stopsList;
|
||||||
|
@FXML
|
||||||
|
private ListView<Trip> tripsList;
|
||||||
|
@FXML
|
||||||
|
private ObservableList<Trip> trips;
|
||||||
|
|
||||||
|
public void setRideDays(Label day, boolean travelling){
|
||||||
|
if (travelling){
|
||||||
|
day.setTextFill(Color.GREEN);
|
||||||
|
}else{
|
||||||
|
day.setTextFill(Color.RED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runLater(){
|
||||||
|
//fill tables etc;
|
||||||
|
trips = parent.getSession().getDataManager().getTrips();
|
||||||
|
tripsList.setItems(trips);
|
||||||
|
tripsList.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> {
|
||||||
|
Trip trip = tripsList.getSelectionModel().getSelectedItem();
|
||||||
|
stopsList.setItems(trip.route);
|
||||||
|
rideLabel.setText(trip.ride.toString());
|
||||||
|
directionLabel.setText(trip.direction);
|
||||||
|
setRideDays(mondayLabel, trip.days[Trip.MONDAY]);
|
||||||
|
setRideDays(tuesdayLabel, trip.days[Trip.TUESDAY]);
|
||||||
|
setRideDays(wednesdayLabel, trip.days[Trip.WEDNESDAY]);
|
||||||
|
setRideDays(thursdayLabel, trip.days[Trip.THURSDAY]);
|
||||||
|
setRideDays(fridayLabel, trip.days[Trip.FRIDAY]);
|
||||||
|
if (trip.reoccur){
|
||||||
|
reoccuringLabel.setText("Yes");
|
||||||
|
endDateLabel.setText(trip.endDate);
|
||||||
|
}else{
|
||||||
|
reoccuringLabel.setText("No");
|
||||||
|
endDateLabel.setText("-");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initialize(URL location, ResourceBundle resources) {
|
||||||
|
rideLabel.setText("-");
|
||||||
|
directionLabel.setText("-");
|
||||||
|
reoccuringLabel.setText("-");
|
||||||
|
endDateLabel.setText("-");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,23 +11,25 @@ import java.util.Arrays;
|
|||||||
*/
|
*/
|
||||||
public class Trip {
|
public class Trip {
|
||||||
|
|
||||||
protected transient ObservableList<TripStop> route;
|
public transient ObservableList<TripStop> route;
|
||||||
private ArrayList<TripStop> serialisedRoute;
|
private ArrayList<TripStop> serialisedRoute;
|
||||||
protected String direction;
|
public String direction;
|
||||||
protected Ride ride;
|
public Ride ride;
|
||||||
protected boolean[] days;
|
public boolean[] days;
|
||||||
protected boolean reoccur;
|
public boolean reoccur;
|
||||||
protected String endDate;
|
public String endDate;
|
||||||
|
public String name;
|
||||||
|
|
||||||
static int MONDAY = 0;
|
public static int MONDAY = 0;
|
||||||
static int TUESDAY = 1;
|
public static int TUESDAY = 1;
|
||||||
static int WEDNESDAY = 2;
|
public static int WEDNESDAY = 2;
|
||||||
static int THURSDAY = 3;
|
public static int THURSDAY = 3;
|
||||||
static int FRIDAY = 4;
|
public static int FRIDAY = 4;
|
||||||
static int SATURDAY = 5;
|
public static int SATURDAY = 5;
|
||||||
static int SUNDAY = 6;
|
public static int SUNDAY = 6;
|
||||||
|
|
||||||
public Trip(ObservableList<TripStop> route, String direction, Ride ride, boolean[] days, boolean reoccur, String endDate){
|
public Trip(String name, ObservableList<TripStop> route, String direction, Ride ride, boolean[] days, boolean reoccur, String endDate){
|
||||||
|
this.name = name;
|
||||||
this.route = route;
|
this.route = route;
|
||||||
this.direction = direction;
|
this.direction = direction;
|
||||||
this.ride = ride;
|
this.ride = ride;
|
||||||
@@ -37,12 +39,11 @@ public class Trip {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String toString(){
|
public String toString(){
|
||||||
String tripString = String.format("This trip has %s stops and driven by %s.", route.size(), ride);
|
return name;
|
||||||
return tripString;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean equals(Trip trip){
|
public boolean equals(Trip trip){
|
||||||
if (trip.direction.equals(direction) && ride.equals(trip.ride) && Arrays.equals(trip.days,days) && trip.reoccur == reoccur
|
if (trip.name.equals(name) && trip.direction.equals(direction) && ride.equals(trip.ride) && Arrays.equals(trip.days,days) && trip.reoccur == reoccur
|
||||||
&& trip.endDate.equals(endDate)){
|
&& trip.endDate.equals(endDate)){
|
||||||
for (int i = 0; i < trip.route.size(); i++){
|
for (int i = 0; i < trip.route.size(); i++){
|
||||||
if (!route.get(i).equals(trip.route.get(i))){
|
if (!route.get(i).equals(trip.route.get(i))){
|
||||||
|
|||||||
@@ -17,7 +17,8 @@
|
|||||||
<rowConstraints>
|
<rowConstraints>
|
||||||
<RowConstraints maxHeight="50.0" minHeight="50.0" prefHeight="50.0" vgrow="SOMETIMES" />
|
<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 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 prefHeight="348.0" vgrow="SOMETIMES" />
|
||||||
<RowConstraints minHeight="40.0" prefHeight="40.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="40.0" prefHeight="40.0" vgrow="SOMETIMES" />
|
||||||
</rowConstraints>
|
</rowConstraints>
|
||||||
@@ -27,18 +28,18 @@
|
|||||||
<Font size="18.0" />
|
<Font size="18.0" />
|
||||||
</font>
|
</font>
|
||||||
</Label>
|
</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>
|
||||||
<Font size="16.0" />
|
<Font size="16.0" />
|
||||||
</font>
|
</font>
|
||||||
</Label>
|
</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>
|
||||||
<Font size="16.0" />
|
<Font size="16.0" />
|
||||||
</font>
|
</font>
|
||||||
</Label>
|
</Label>
|
||||||
<ComboBox fx:id="routeDropdown" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="1" />
|
<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">
|
<TableView fx:id="routeTable" editable="true" prefHeight="200.0" prefWidth="200.0" GridPane.columnSpan="2" GridPane.rowIndex="3" GridPane.rowSpan="2">
|
||||||
<columns>
|
<columns>
|
||||||
<TableColumn fx:id="stopName" editable="false" maxWidth="-1.0" minWidth="150.0" prefWidth="150.0" resizable="false" text="Stop" />
|
<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" />
|
<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" />
|
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
|
||||||
</columnResizePolicy>
|
</columnResizePolicy>
|
||||||
</TableView>
|
</TableView>
|
||||||
<GridPane GridPane.columnIndex="2" GridPane.columnSpan="2" GridPane.rowIndex="3">
|
<GridPane GridPane.columnIndex="2" GridPane.columnSpan="2" GridPane.rowIndex="4">
|
||||||
<columnConstraints>
|
<columnConstraints>
|
||||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||||
<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" />
|
<ComboBox fx:id="reoccur" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="4" />
|
||||||
</children>
|
</children>
|
||||||
</GridPane>
|
</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>
|
||||||
<Font size="16.0" />
|
<Font size="16.0" />
|
||||||
</font>
|
</font>
|
||||||
</Label>
|
</Label>
|
||||||
<ComboBox fx:id="direction" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="2" />
|
<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="4" />
|
<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.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="1">
|
<Label text="Select Car:" GridPane.halignment="CENTER" GridPane.rowIndex="2">
|
||||||
<font>
|
<font>
|
||||||
<Font size="16.0" />
|
<Font size="16.0" />
|
||||||
</font>
|
</font>
|
||||||
</Label>
|
</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>
|
</children>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
</children>
|
</children>
|
||||||
|
|||||||
@@ -46,6 +46,11 @@
|
|||||||
<Button mnemonicParsing="false" onAction="#myRoutes" text="Routes" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" />
|
<Button mnemonicParsing="false" onAction="#myRoutes" text="Routes" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" />
|
||||||
</children>
|
</children>
|
||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
|
<AnchorPane>
|
||||||
|
<children>
|
||||||
|
<Button mnemonicParsing="false" onAction="#myTrips" text="Trips" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" />
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
</children>
|
</children>
|
||||||
</VBox>
|
</VBox>
|
||||||
</children>
|
</children>
|
||||||
|
|||||||
@@ -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>
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -17,7 +17,8 @@
|
|||||||
<rowConstraints>
|
<rowConstraints>
|
||||||
<RowConstraints maxHeight="50.0" minHeight="50.0" prefHeight="50.0" vgrow="SOMETIMES" />
|
<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 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 prefHeight="348.0" vgrow="SOMETIMES" />
|
||||||
<RowConstraints minHeight="40.0" prefHeight="40.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="40.0" prefHeight="40.0" vgrow="SOMETIMES" />
|
||||||
</rowConstraints>
|
</rowConstraints>
|
||||||
@@ -27,18 +28,18 @@
|
|||||||
<Font size="18.0" />
|
<Font size="18.0" />
|
||||||
</font>
|
</font>
|
||||||
</Label>
|
</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>
|
||||||
<Font size="16.0" />
|
<Font size="16.0" />
|
||||||
</font>
|
</font>
|
||||||
</Label>
|
</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>
|
||||||
<Font size="16.0" />
|
<Font size="16.0" />
|
||||||
</font>
|
</font>
|
||||||
</Label>
|
</Label>
|
||||||
<ComboBox fx:id="routeDropdown" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="1" />
|
<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">
|
<TableView fx:id="routeTable" editable="true" prefHeight="200.0" prefWidth="200.0" GridPane.columnSpan="2" GridPane.rowIndex="3" GridPane.rowSpan="2">
|
||||||
<columns>
|
<columns>
|
||||||
<TableColumn fx:id="stopName" editable="false" maxWidth="-1.0" minWidth="150.0" prefWidth="150.0" resizable="false" text="Stop" />
|
<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" />
|
<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" />
|
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
|
||||||
</columnResizePolicy>
|
</columnResizePolicy>
|
||||||
</TableView>
|
</TableView>
|
||||||
<GridPane GridPane.columnIndex="2" GridPane.columnSpan="2" GridPane.rowIndex="3">
|
<GridPane GridPane.columnIndex="2" GridPane.columnSpan="2" GridPane.rowIndex="4">
|
||||||
<columnConstraints>
|
<columnConstraints>
|
||||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||||
<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" />
|
<ComboBox fx:id="reoccur" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="4" />
|
||||||
</children>
|
</children>
|
||||||
</GridPane>
|
</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>
|
||||||
<Font size="16.0" />
|
<Font size="16.0" />
|
||||||
</font>
|
</font>
|
||||||
</Label>
|
</Label>
|
||||||
<ComboBox fx:id="direction" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="2" />
|
<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="4" />
|
<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.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="1">
|
<Label text="Select Car:" GridPane.halignment="CENTER" GridPane.rowIndex="2">
|
||||||
<font>
|
<font>
|
||||||
<Font size="16.0" />
|
<Font size="16.0" />
|
||||||
</font>
|
</font>
|
||||||
</Label>
|
</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>
|
</children>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
</children>
|
</children>
|
||||||
|
|||||||
@@ -46,6 +46,11 @@
|
|||||||
<Button mnemonicParsing="false" onAction="#myRoutes" text="Routes" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" />
|
<Button mnemonicParsing="false" onAction="#myRoutes" text="Routes" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" />
|
||||||
</children>
|
</children>
|
||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
|
<AnchorPane>
|
||||||
|
<children>
|
||||||
|
<Button mnemonicParsing="false" onAction="#myTrips" text="Trips" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" />
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
</children>
|
</children>
|
||||||
</VBox>
|
</VBox>
|
||||||
</children>
|
</children>
|
||||||
|
|||||||
@@ -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 @@
|
|||||||
[{"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"}]
|
||||||
Reference in New Issue
Block a user