parent
e4ed24f12d
commit
3cec10ffc6
@ -0,0 +1,38 @@
|
||||
package controllers;
|
||||
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableView;
|
||||
import model.SharedTrip;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
/**
|
||||
* Created by Gondr on 28/05/2017.
|
||||
*/
|
||||
public class SharedTripsController extends Controller{
|
||||
|
||||
@FXML
|
||||
private TableView<SharedTrip> sharedTripsTable;
|
||||
@FXML
|
||||
private TableColumn<SharedTrip, String> tripNameColumn;
|
||||
@FXML
|
||||
private TableColumn<SharedTrip, String> directionColumn;
|
||||
@FXML
|
||||
private TableColumn<SharedTrip, String> daysColumn;
|
||||
|
||||
@Override
|
||||
public void runLater(){
|
||||
sharedTripsTable.setItems(parent.getSession().getDataManager().getSharedTrips());
|
||||
tripNameColumn.setCellValueFactory(p -> new SimpleStringProperty(p.getValue().name));
|
||||
directionColumn.setCellValueFactory(p -> new SimpleStringProperty(p.getValue().direction));
|
||||
daysColumn.setCellValueFactory(p -> new SimpleStringProperty(p.getValue().getDays()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize(URL location, ResourceBundle resources) {
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
<?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.SharedTripsController">
|
||||
<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>
|
||||
<Label text="Shared Trips" GridPane.columnSpan="3" GridPane.halignment="CENTER">
|
||||
<font>
|
||||
<Font size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<TableView fx:id="sharedTripsTable" prefHeight="200.0" prefWidth="200.0" GridPane.columnSpan="3" GridPane.rowIndex="2">
|
||||
<columns>
|
||||
<TableColumn fx:id="tripNameColumn" prefWidth="75.0" text="Trip Name" />
|
||||
<TableColumn fx:id="directionColumn" prefWidth="75.0" text="Direction" />
|
||||
<TableColumn fx:id="daysColumn" prefWidth="75.0" text="Days" />
|
||||
</columns>
|
||||
</TableView>
|
||||
</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.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,38 @@
|
||||
<?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.SharedTripsController">
|
||||
<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>
|
||||
<Label text="Shared Trips" GridPane.columnSpan="3" GridPane.halignment="CENTER">
|
||||
<font>
|
||||
<Font size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<TableView fx:id="sharedTripsTable" prefHeight="200.0" prefWidth="200.0" GridPane.columnSpan="3" GridPane.rowIndex="2">
|
||||
<columns>
|
||||
<TableColumn fx:id="tripNameColumn" prefWidth="75.0" text="Trip Name" />
|
||||
<TableColumn fx:id="directionColumn" prefWidth="75.0" text="Direction" />
|
||||
<TableColumn fx:id="daysColumn" prefWidth="75.0" text="Days" />
|
||||
</columns>
|
||||
</TableView>
|
||||
</children>
|
||||
</GridPane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
@ -1 +1 @@
|
||||
[{"model":"a","colour":"a","licensePlate":"a","year":1996,"numSeats":5}]
|
||||
[{"model":"Nissan March","colour":"Baby Blue","licensePlate":"EPU001","year":2004,"numSeats":5}]
|
||||
@ -1 +1 @@
|
||||
[{"name":"asdf","serialisedStops":[{"address":"54 fwqfqwf"}]}]
|
||||
[{"name":"Home to University","serialisedStops":[{"address":"1 Avonhead Road"},{"address":"1 University Drive"}]},{"name":"Friends Route","serialisedStops":[{"address":"100 Yaldhurst Road"},{"address":"120 Maidstone Road"},{"address":"1 Homestead Lane"}]}]
|
||||
@ -1 +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"}]
|
||||
[{"serialisedRoute":[{"serialiseTime":"9:00","serialiseName":"1 Avonhead Road"},{"serialiseTime":"9:15","serialiseName":"1 University Drive"}],"direction":"University","ride":{"model":"Nissan March","colour":"Baby Blue","licensePlate":"EPU001","year":2004,"numSeats":5},"days":[false,true,true,false,true,false,false],"reoccur":true,"endDate":"30-12-2017","name":"Home to Uni"}]
|
||||
@ -1 +1 @@
|
||||
[{"address":"54 fwqfqwf"}]
|
||||
[{"address":"1 Avonhead Road"},{"address":"100 Yaldhurst Road"},{"address":"120 Maidstone Road"},{"address":"1 University Drive"},{"address":"1 Homestead Lane"}]
|
||||
@ -1 +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"}]
|
||||
[{"serialisedRoute":[{"serialiseTime":"9:00","serialiseName":"1 Avonhead Road"},{"serialiseTime":"9:15","serialiseName":"1 University Drive"}],"direction":"University","ride":{"model":"Nissan March","colour":"Baby Blue","licensePlate":"EPU001","year":2004,"numSeats":5},"days":[false,true,true,false,true,false,false],"reoccur":true,"endDate":"30-12-2017","name":"Home to Uni"}]
|
||||
Loading…
Reference in new issue