Implemented the raw data button on the flight summary page so it changes the scene
This commit is contained in:
@@ -2,12 +2,17 @@ package seng202.group9.GUI;
|
|||||||
|
|
||||||
import javafx.collections.FXCollections;
|
import javafx.collections.FXCollections;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
|
import javafx.event.ActionEvent;
|
||||||
|
import javafx.event.EventHandler;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.fxml.Initializable;
|
import javafx.fxml.Initializable;
|
||||||
|
import javafx.scene.control.Button;
|
||||||
import javafx.scene.control.ListView;
|
import javafx.scene.control.ListView;
|
||||||
|
import javafx.scene.control.TableView;
|
||||||
import seng202.group9.Controller.App;
|
import seng202.group9.Controller.App;
|
||||||
import seng202.group9.Controller.Dataset;
|
import seng202.group9.Controller.Dataset;
|
||||||
import seng202.group9.Core.FlightPath;
|
import seng202.group9.Core.FlightPath;
|
||||||
|
import seng202.group9.Core.FlightPoint;
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -26,6 +31,9 @@ public class FlightSummaryController implements Initializable {
|
|||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private Button flightRawData;
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
ListView<String> flightPathListView;
|
ListView<String> flightPathListView;
|
||||||
final ObservableList<String> flightList = FXCollections.observableArrayList();
|
final ObservableList<String> flightList = FXCollections.observableArrayList();
|
||||||
@@ -52,6 +60,22 @@ public class FlightSummaryController implements Initializable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Changes to the Flight Raw Data Scene when the Raw Data Button is clicked
|
||||||
|
*/
|
||||||
|
public void handleRawDataButton() {
|
||||||
|
try {
|
||||||
|
FlightRawDataController rawDataController = (FlightRawDataController)
|
||||||
|
parent.replaceSceneContent("flight_raw_data.fxml");
|
||||||
|
rawDataController.setApp(parent);
|
||||||
|
rawDataController.loadTables();
|
||||||
|
rawDataController.flightPathListView();
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void initialize(URL arg0, ResourceBundle arg1) {
|
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,7 @@
|
|||||||
<Font size="12.0" />
|
<Font size="12.0" />
|
||||||
</font>
|
</font>
|
||||||
</Button>
|
</Button>
|
||||||
<Button layoutX="33.0" layoutY="129.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="250.0" text="Flight Raw Data" />
|
<Button layoutX="33.0" layoutY="129.0" mnemonicParsing="false" onAction="#handleRawDataButton" prefHeight="25.0" prefWidth="250.0" text="Flight Raw Data" />
|
||||||
</children>
|
</children>
|
||||||
<padding>
|
<padding>
|
||||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||||
|
|||||||
Reference in New Issue
Block a user