Users can share rides now but can't see shared ones yet

main
Fan-Wu Yang 9 years ago
parent 8abe49ab15
commit e4ed24f12d

@ -94,11 +94,10 @@ public class AddTripController extends Controller{
} }
Trip trip = new Trip(tripName.getText() ,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.CONFIRMATION, "Success!", "Trip Added", String.format("Your Trip %1s has been added successfully!\n\nWould you like to add another trip?", tripName.getText()), ButtonSets.YesNo);
parent.getSession().getDataManager().addTrip(trip); parent.getSession().getDataManager().addTrip(trip);
if (result.get() == ButtonTypes.No){ if (result.get() == ButtonTypes.No){
System.out.println("My Trips page to show up and impletmeneted");//TODO implement here. changeScene(SceneCode.MY_TRIPS);
//changeScene(SceneCode.MY_TRIPS);
} else{ } else{
changeScene(SceneCode.ADD_TRIP); changeScene(SceneCode.ADD_TRIP);
} }

@ -53,6 +53,10 @@ public class BaseController extends Controller {
changeScene(SceneCode.MY_TRIPS); changeScene(SceneCode.MY_TRIPS);
} }
public void shareRide() 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) {

@ -23,8 +23,8 @@ public abstract class Controller implements Initializable {
this.parent = parent; this.parent = parent;
} }
public void changeScene(SceneCode scene) throws Exception { public Controller changeScene(SceneCode scene) throws Exception {
parent.replaceSceneContent(scene); return parent.replaceSceneContent(scene);
} }
public void runLater(){ public void runLater(){

@ -72,7 +72,7 @@ public class Main extends Application {
* @return * @return
* @throws Exception * @throws Exception
*/ */
public void replaceSceneContent(SceneCode fxml) throws Exception { public Controller replaceSceneContent(SceneCode fxml) throws Exception {
FXMLLoader loader = new FXMLLoader(); FXMLLoader loader = new FXMLLoader();
InputStream in = getClass().getClassLoader().getResourceAsStream(fxml.getPath()); InputStream in = getClass().getClassLoader().getResourceAsStream(fxml.getPath());
Parent page; Parent page;
@ -101,6 +101,7 @@ public class Main extends Application {
controller.setParent(this); controller.setParent(this);
controller.runLater(); controller.runLater();
} }
return controller;
} }
public Session getSession() { public Session getSession() {

@ -2,16 +2,14 @@ package controllers;
import javafx.collections.ObservableList; import javafx.collections.ObservableList;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.control.Label; import javafx.scene.control.*;
import javafx.scene.control.ListView;
import javafx.scene.control.TableView;
import javafx.scene.layout.Background; import javafx.scene.layout.Background;
import javafx.scene.layout.BackgroundFill; import javafx.scene.layout.BackgroundFill;
import javafx.scene.paint.Color; import javafx.scene.paint.Color;
import model.Trip; import model.*;
import model.TripStop;
import java.net.URL; import java.net.URL;
import java.util.Optional;
import java.util.ResourceBundle; import java.util.ResourceBundle;
/** /**
@ -33,6 +31,10 @@ public class MyTripsController extends Controller{
@FXML @FXML
private Label fridayLabel; private Label fridayLabel;
@FXML @FXML
private Label saturdayLabel;
@FXML
private Label sundayLabel;
@FXML
private Label reoccuringLabel; private Label reoccuringLabel;
@FXML @FXML
private Label endDateLabel; private Label endDateLabel;
@ -40,10 +42,16 @@ public class MyTripsController extends Controller{
private TableView<TripStop> stopsList; private TableView<TripStop> stopsList;
@FXML @FXML
private ListView<Trip> tripsList; private ListView<Trip> tripsList;
@FXML
private ObservableList<Trip> trips; private ObservableList<Trip> trips;
@FXML
private TableColumn<TripStop, String> stopTimeColumn;
@FXML
private TableColumn<TripStop, String> stopNameColumn;
@FXML
private TextField seatsAvailable;
private Trip selectedTrip;
public void setRideDays(Label day, boolean travelling){ private void setRideDays(Label day, boolean travelling){
if (travelling){ if (travelling){
day.setTextFill(Color.GREEN); day.setTextFill(Color.GREEN);
}else{ }else{
@ -51,24 +59,53 @@ public class MyTripsController extends Controller{
} }
} }
public void shareThisRide(){
if (selectedTrip != null && seatsAvailable.getText() != null && seatsAvailable.getText() != ""){
int seats;
try{
seats = Integer.parseInt(seatsAvailable.getText());
}catch(NumberFormatException e){
popUp(Alert.AlertType.WARNING, "WARNING!", "Error in Seats Available Input.", "Seats Input must be an Integer.");
return;
}
if (selectedTrip.ride.getNumSeats() < 0){
Optional<ButtonType> result = popUp(Alert.AlertType.WARNING, "WARNING!", "Seats less than 0.", "This will make all seats unavailable is this what you want?", ButtonSets.YesNo);
if (result.get() == ButtonTypes.No){
return;
}
}
if (selectedTrip.ride.getNumSeats() > seats){
parent.getSession().getDataManager().addSharedTrip(new SharedTrip(selectedTrip));
popUp(Alert.AlertType.CONFIRMATION, "SUCCESS!", "Trip has been successfully shared", "The trip can now be seen by other users when there are seats available.");
//TODO change scene
} else{
popUp(Alert.AlertType.WARNING, "WARNING!", "Error in Seats Available Input.", "You cannot share more seats than you have available (remember you need one for you to drive in).");
}
}
}
@Override @Override
public void runLater(){ public void runLater(){
//fill tables etc; //fill tables etc;
trips = parent.getSession().getDataManager().getTrips(); trips = parent.getSession().getDataManager().getTrips();
tripsList.setItems(trips); tripsList.setItems(trips);
stopTimeColumn.setCellValueFactory(p -> p.getValue().nameProperty());
stopNameColumn.setCellValueFactory(p -> p.getValue().nameProperty());
tripsList.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> { tripsList.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> {
Trip trip = tripsList.getSelectionModel().getSelectedItem(); selectedTrip = tripsList.getSelectionModel().getSelectedItem();
stopsList.setItems(trip.route); stopsList.setItems(selectedTrip.route);
rideLabel.setText(trip.ride.toString()); rideLabel.setText(selectedTrip.ride.toString());
directionLabel.setText(trip.direction); directionLabel.setText(selectedTrip.direction);
setRideDays(mondayLabel, trip.days[Trip.MONDAY]); setRideDays(mondayLabel, selectedTrip.days[Trip.MONDAY]);
setRideDays(tuesdayLabel, trip.days[Trip.TUESDAY]); setRideDays(tuesdayLabel, selectedTrip.days[Trip.TUESDAY]);
setRideDays(wednesdayLabel, trip.days[Trip.WEDNESDAY]); setRideDays(wednesdayLabel, selectedTrip.days[Trip.WEDNESDAY]);
setRideDays(thursdayLabel, trip.days[Trip.THURSDAY]); setRideDays(thursdayLabel, selectedTrip.days[Trip.THURSDAY]);
setRideDays(fridayLabel, trip.days[Trip.FRIDAY]); setRideDays(fridayLabel, selectedTrip.days[Trip.FRIDAY]);
if (trip.reoccur){ setRideDays(saturdayLabel, selectedTrip.days[Trip.SATURDAY]);
setRideDays(sundayLabel, selectedTrip.days[Trip.SUNDAY]);
if (selectedTrip.reoccur){
reoccuringLabel.setText("Yes"); reoccuringLabel.setText("Yes");
endDateLabel.setText(trip.endDate); endDateLabel.setText(selectedTrip.endDate);
}else{ }else{
reoccuringLabel.setText("No"); reoccuringLabel.setText("No");
endDateLabel.setText("-"); endDateLabel.setText("-");

@ -16,16 +16,18 @@ public class DataManager {
private ObservableList<Stop> stops; private ObservableList<Stop> stops;
private ObservableList<Route> routes; private ObservableList<Route> routes;
private ObservableList<Trip> trips; private ObservableList<Trip> trips;
private ObservableList<SharedTrip> sharedTrips;
public DataManager(List rides, List stops, List routes, List trips){ public DataManager(List rides, List stops, List routes, List trips, List sharedTrips){
this.rides = FXCollections.observableArrayList(rides); this.rides = FXCollections.observableArrayList(rides);
this.stops = FXCollections.observableArrayList(stops); this.stops = FXCollections.observableArrayList(stops);
this.routes = FXCollections.observableArrayList(routes); this.routes = FXCollections.observableArrayList(routes);
this.trips = FXCollections.observableArrayList(trips); this.trips = FXCollections.observableArrayList(trips);
this.sharedTrips = FXCollections.observableArrayList(sharedTrips);
} }
public DataManager(){ public DataManager(){
this(FXCollections.observableArrayList(), FXCollections.observableArrayList(), FXCollections.observableArrayList(), FXCollections.observableArrayList()); this(FXCollections.observableArrayList(), FXCollections.observableArrayList(), FXCollections.observableArrayList(), FXCollections.observableArrayList(), FXCollections.observableArrayList());
} }
public ObservableList<Ride> getRides() { public ObservableList<Ride> getRides() {
@ -86,4 +88,18 @@ public class DataManager {
return true; return true;
} }
public ObservableList<SharedTrip> getSharedTrips() {
return sharedTrips;
}
public boolean addSharedTrip(SharedTrip sharedTrip){
for (SharedTrip t: sharedTrips){
if (sharedTrip.equals(t)){
return false;
}
}
sharedTrips.add(sharedTrip);
return true;
}
} }

@ -17,6 +17,25 @@ public class Ride {
this.numSeats = numSeats; this.numSeats = numSeats;
} }
public String getModel() {
return model;
}
public String getColour() {
return colour;
}
public String getLicensePlate() {
return licensePlate;
}
public int getYear() {
return year;
}
public int getNumSeats() {
return numSeats;
}
@Override @Override
public String toString(){ public String toString(){

@ -0,0 +1,12 @@
package model;
/**
* Created by Gondr on 28/05/2017.
*/
public class SharedTrip extends Trip {
public SharedTrip (Trip trip){
super(trip.name, trip.route, trip.direction, trip.ride, trip.days, trip.reoccur, trip.endDate);
}
}

@ -30,11 +30,13 @@ public class DataManagerSerialiser extends Serialiser {
ArrayList<Stop> stops = new ArrayList<>(dataManager.getStops()); ArrayList<Stop> stops = new ArrayList<>(dataManager.getStops());
ArrayList<Route> routes = new ArrayList<>(dataManager.getRoutes()); ArrayList<Route> routes = new ArrayList<>(dataManager.getRoutes());
ArrayList<Trip> trips = new ArrayList<>(dataManager.getTrips()); ArrayList<Trip> trips = new ArrayList<>(dataManager.getTrips());
ArrayList<SharedTrip> sharedTrips = new ArrayList<>(dataManager.getSharedTrips());
boolean serialRidesSuccess = serialise(rides, "serialisation/rides.json"); boolean serialRidesSuccess = serialise(rides, "serialisation/rides.json");
boolean serialStopsSuccess = serialise(stops, "serialisation/stops.json"); boolean serialStopsSuccess = serialise(stops, "serialisation/stops.json");
boolean serialRoutesSuccess = serialiseRoutes(routes, "serialisation/routes.json"); boolean serialRoutesSuccess = serialiseRoutes(routes, "serialisation/routes.json");
boolean serialTripsSuccess = serialiseTrips(trips, "serialisation/trips.json"); boolean serialTripsSuccess = serialiseTrips(trips, "serialisation/trips.json");
return (serialRidesSuccess && serialStopsSuccess && serialRoutesSuccess && serialTripsSuccess); boolean serialSharedTripsSuccess = serialiseSharedTrips(sharedTrips, "serialisation/sharedtrips.json");
return (serialRidesSuccess && serialStopsSuccess && serialRoutesSuccess && serialTripsSuccess && serialSharedTripsSuccess);
} }
/** /**
@ -81,6 +83,29 @@ public class DataManagerSerialiser extends Serialiser {
return true; return true;
} }
/**
* Serialises trips
* @param trips Trips to be serialised
* @param filepath File path to serialise it to.
* @return
*/
public boolean serialiseSharedTrips(ArrayList<SharedTrip> trips, String filepath){
for (Trip trip: trips){
trip.serialise();
}
try{
String path = getClass().getClassLoader().getResource(filepath).getPath();
Writer writer = new OutputStreamWriter(new FileOutputStream(path), "UTF-8");
gson.toJson(trips, writer);
writer.close();
} catch (IOException e) {
e.printStackTrace();
return false;
}
return true;
}
/** /**
* loads the data manager from file * loads the data manager from file
* @return whether the data was loaded properly or not * @return whether the data was loaded properly or not
@ -115,7 +140,15 @@ public class DataManagerSerialiser extends Serialiser {
trip.deserialise(); trip.deserialise();
} }
return new DataManager(rides, stops, routes, trips); Reader reader5 = new InputStreamReader(getClass().getClassLoader().getResourceAsStream("serialisation/trips.json"), "UTF-8");
ArrayList<SharedTrip> sharedTrips = gson.fromJson(reader4, new TypeToken<ArrayList<SharedTrip>>(){}.getType());
reader5.close();
for (SharedTrip trip: sharedTrips){
trip.deserialise();
}
return new DataManager(rides, stops, routes, trips, sharedTrips);
} }
} }

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.text.*?>
<?import javafx.geometry.*?> <?import javafx.geometry.*?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import java.lang.*?> <?import java.lang.*?>
@ -9,7 +10,7 @@
<children> <children>
<GridPane fx:id="base" layoutX="56.0" layoutY="75.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <GridPane fx:id="base" layoutX="56.0" layoutY="75.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="200.0" minWidth="200.0" prefWidth="200.0" /> <ColumnConstraints hgrow="SOMETIMES" maxWidth="200.0" prefWidth="200.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="10.0" /> <ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="10.0" />
</columnConstraints> </columnConstraints>
<rowConstraints> <rowConstraints>
@ -17,7 +18,7 @@
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints> </rowConstraints>
<children> <children>
<Accordion GridPane.rowSpan="2"> <Accordion maxWidth="200.0" minWidth="200.0" prefWidth="200.0" GridPane.rowSpan="2">
<panes> <panes>
<TitledPane animated="false" text="User Profile"> <TitledPane animated="false" text="User Profile">
<content> <content>
@ -65,10 +66,36 @@
</columnConstraints> </columnConstraints>
<rowConstraints> <rowConstraints>
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints />
</rowConstraints> </rowConstraints>
<children> <children>
<VBox> <VBox>
<children> <children>
<AnchorPane>
<children>
<Label alignment="CENTER" contentDisplay="CENTER" text="Actions" textAlignment="CENTER" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
<font>
<Font name="System Bold" size="14.0" />
</font>
</Label>
</children>
</AnchorPane>
<Separator prefWidth="200.0" />
<AnchorPane>
<children>
<Button mnemonicParsing="false" onAction="#shareRide" text="Share Ride" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" />
</children>
</AnchorPane>
<AnchorPane>
<children>
<Label alignment="CENTER" text="Add Information" textAlignment="JUSTIFY" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
<font>
<Font name="System Bold" size="14.0" />
</font>
</Label>
</children>
</AnchorPane>
<Separator prefWidth="200.0" />
<AnchorPane> <AnchorPane>
<children> <children>
<Button mnemonicParsing="false" onAction="#addRide" text="Add Ride" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" GridPane.hgrow="ALWAYS" GridPane.valignment="TOP" GridPane.vgrow="ALWAYS" /> <Button mnemonicParsing="false" onAction="#addRide" text="Add Ride" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" GridPane.hgrow="ALWAYS" GridPane.valignment="TOP" GridPane.vgrow="ALWAYS" />

@ -38,8 +38,8 @@
</Label> </Label>
<TableView fx:id="stopsList" prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="2"> <TableView fx:id="stopsList" prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="2">
<columns> <columns>
<TableColumn prefWidth="104.0" text="Time" /> <TableColumn fx:id="stopTimeColumn" prefWidth="104.0" text="Time" />
<TableColumn prefWidth="95.0" text="Stop" /> <TableColumn fx:id="stopNameColumn" prefWidth="95.0" text="Stop" />
</columns> </columns>
</TableView> </TableView>
<Label text="Information" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="1"> <Label text="Information" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="1">
@ -58,6 +58,8 @@
<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 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> <children>
<Label text="Ride:" /> <Label text="Ride:" />
@ -71,6 +73,11 @@
<Label fx:id="endDateLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="4" /> <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"> <HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="2" GridPane.valignment="CENTER">
<children> <children>
<Label fx:id="sundayLabel" style="-fx-border-color: #F0F0F0; -fx-border-width: 1;" text="S">
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
</Label>
<Label fx:id="mondayLabel" style="-fx-border-color: #F0F0F0; -fx-border-width: 1;" text="M" AnchorPane.bottomAnchor="23.0" AnchorPane.topAnchor="22.0"> <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> <HBox.margin>
<Insets /> <Insets />
@ -99,11 +106,23 @@
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding> </padding>
</Label> </Label>
<Label fx:id="saturdayLabel" style="-fx-border-color: #F0F0F0; -fx-border-width: 1;" text="S">
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
</Label>
</children> </children>
</HBox> </HBox>
<AnchorPane GridPane.columnSpan="2" GridPane.rowIndex="6">
<children>
<Button mnemonicParsing="false" onAction="#shareThisRide" text="Share This Ride" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" GridPane.rowIndex="5" />
</children>
</AnchorPane>
<TextField fx:id="seatsAvailable" text="0" GridPane.columnIndex="1" GridPane.rowIndex="5" />
<Label text="Seats Available:" GridPane.rowIndex="5" />
</children> </children>
<GridPane.margin> <GridPane.margin>
<Insets left="10.0" /> <Insets left="10.0" right="10.0" />
</GridPane.margin> </GridPane.margin>
</GridPane> </GridPane>
</children> </children>

Binary file not shown.

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.text.*?>
<?import javafx.geometry.*?> <?import javafx.geometry.*?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import java.lang.*?> <?import java.lang.*?>
@ -9,7 +10,7 @@
<children> <children>
<GridPane fx:id="base" layoutX="56.0" layoutY="75.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <GridPane fx:id="base" layoutX="56.0" layoutY="75.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="200.0" minWidth="200.0" prefWidth="200.0" /> <ColumnConstraints hgrow="SOMETIMES" maxWidth="200.0" prefWidth="200.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="10.0" /> <ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="10.0" />
</columnConstraints> </columnConstraints>
<rowConstraints> <rowConstraints>
@ -17,7 +18,7 @@
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints> </rowConstraints>
<children> <children>
<Accordion GridPane.rowSpan="2"> <Accordion maxWidth="200.0" minWidth="200.0" prefWidth="200.0" GridPane.rowSpan="2">
<panes> <panes>
<TitledPane animated="false" text="User Profile"> <TitledPane animated="false" text="User Profile">
<content> <content>
@ -65,10 +66,36 @@
</columnConstraints> </columnConstraints>
<rowConstraints> <rowConstraints>
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints />
</rowConstraints> </rowConstraints>
<children> <children>
<VBox> <VBox>
<children> <children>
<AnchorPane>
<children>
<Label alignment="CENTER" contentDisplay="CENTER" text="Actions" textAlignment="CENTER" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
<font>
<Font name="System Bold" size="14.0" />
</font>
</Label>
</children>
</AnchorPane>
<Separator prefWidth="200.0" />
<AnchorPane>
<children>
<Button mnemonicParsing="false" onAction="#shareRide" text="Share Ride" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" />
</children>
</AnchorPane>
<AnchorPane>
<children>
<Label alignment="CENTER" text="Add Information" textAlignment="JUSTIFY" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
<font>
<Font name="System Bold" size="14.0" />
</font>
</Label>
</children>
</AnchorPane>
<Separator prefWidth="200.0" />
<AnchorPane> <AnchorPane>
<children> <children>
<Button mnemonicParsing="false" onAction="#addRide" text="Add Ride" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" GridPane.hgrow="ALWAYS" GridPane.valignment="TOP" GridPane.vgrow="ALWAYS" /> <Button mnemonicParsing="false" onAction="#addRide" text="Add Ride" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" GridPane.hgrow="ALWAYS" GridPane.valignment="TOP" GridPane.vgrow="ALWAYS" />

@ -38,8 +38,8 @@
</Label> </Label>
<TableView fx:id="stopsList" prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="2"> <TableView fx:id="stopsList" prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="2">
<columns> <columns>
<TableColumn prefWidth="104.0" text="Time" /> <TableColumn fx:id="stopTimeColumn" prefWidth="104.0" text="Time" />
<TableColumn prefWidth="95.0" text="Stop" /> <TableColumn fx:id="stopNameColumn" prefWidth="95.0" text="Stop" />
</columns> </columns>
</TableView> </TableView>
<Label text="Information" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="1"> <Label text="Information" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="1">
@ -58,6 +58,8 @@
<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 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> <children>
<Label text="Ride:" /> <Label text="Ride:" />
@ -71,6 +73,11 @@
<Label fx:id="endDateLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="4" /> <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"> <HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="2" GridPane.valignment="CENTER">
<children> <children>
<Label fx:id="sundayLabel" style="-fx-border-color: #F0F0F0; -fx-border-width: 1;" text="S">
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
</Label>
<Label fx:id="mondayLabel" style="-fx-border-color: #F0F0F0; -fx-border-width: 1;" text="M" AnchorPane.bottomAnchor="23.0" AnchorPane.topAnchor="22.0"> <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> <HBox.margin>
<Insets /> <Insets />
@ -99,11 +106,23 @@
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding> </padding>
</Label> </Label>
<Label fx:id="saturdayLabel" style="-fx-border-color: #F0F0F0; -fx-border-width: 1;" text="S">
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
</Label>
</children> </children>
</HBox> </HBox>
<AnchorPane GridPane.columnSpan="2" GridPane.rowIndex="6">
<children>
<Button mnemonicParsing="false" onAction="#shareThisRide" text="Share This Ride" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" GridPane.rowIndex="5" />
</children>
</AnchorPane>
<TextField fx:id="seatsAvailable" text="0" GridPane.columnIndex="1" GridPane.rowIndex="5" />
<Label text="Seats Available:" GridPane.rowIndex="5" />
</children> </children>
<GridPane.margin> <GridPane.margin>
<Insets left="10.0" /> <Insets left="10.0" right="10.0" />
</GridPane.margin> </GridPane.margin>
</GridPane> </GridPane>
</children> </children>

@ -1 +1 @@
[{"model":"Nissan March","colour":"Baby Blue","licensePlate":"H19405661","year":2004,"numSeats":4}] [{"model":"a","colour":"a","licensePlate":"a","year":1996,"numSeats":5}]

@ -1 +1 @@
[{"name":"University to Dorms","serialisedStops":[{"address":"1 University Drive"},{"address":"1 Homestead Lane"}]}] [{"name":"asdf","serialisedStops":[{"address":"54 fwqfqwf"}]}]

@ -0,0 +1 @@
[{"serialisedRoute":[{"serialiseTime":"3:00","serialiseName":"54 fwqfqwf"}],"direction":"University","ride":{"model":"a","colour":"a","licensePlate":"a","year":1996,"numSeats":5},"days":[true,false,false,true,false,true,false],"reoccur":true,"endDate":"2017-06-08","name":"safsdf"}]

@ -1 +1 @@
[{"address":"1 University Drive"},{"address":"1 Homestead Lane"}] [{"address":"54 fwqfqwf"}]

@ -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":"","name":"University to Home"}] [{"serialisedRoute":[{"serialiseTime":"3:00","serialiseName":"54 fwqfqwf"}],"direction":"University","ride":{"model":"a","colour":"a","licensePlate":"a","year":1996,"numSeats":5},"days":[true,false,false,true,false,true,false],"reoccur":true,"endDate":"2017-06-08","name":"safsdf"}]
Loading…
Cancel
Save