Merge branch 'Analysertab'
Conflicts: src/main/java/seng202/group9/Controller/SceneCode.java
This commit is contained in:
@@ -11,7 +11,8 @@ public enum SceneCode {
|
||||
FLIGHT_RAW_DATA("flight_raw_data.fxml"), AIRPORT_ANALYSER("airport_analyser.fxml"), ROUTE_ANALYSER("route_analyser.fxml"),
|
||||
AIRPORT_DIST_CALC("airport_dist_calc.fxml"), AIRLINE_ADD("airline_add_form.fxml"), AIRLINE_FILTER("airline_filter_form.fxml"),
|
||||
AIRPORT_ADD("airport_add_form.fxml"), AIRPORT_FILTER("airport_filter_form.fxml"), ROUTE_ADD("route_add_form.fxml"),
|
||||
ROUTE_FILTER("route_filter_form.fxml");
|
||||
ROUTE_FILTER("route_filter_form.fxml"),AIRPORT_DIST_CALC("airport_dist_calc.fxml"), ANALYSER_TAB("analyser_main_page.fxml"),
|
||||
BAR_GRAPH_CHOOSER("bar_graph_chooser.fxml"), PIE_GRAPH_CHOOSER("pie_graph_chooser.fxml");
|
||||
|
||||
private String filePath;
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package seng202.group9.GUI;
|
||||
|
||||
import seng202.group9.Controller.SceneCode;
|
||||
|
||||
/**
|
||||
* Created by michael on 24/09/2016.
|
||||
*/
|
||||
public class AnalyserController extends Controller{
|
||||
|
||||
public void barGraphButton(){
|
||||
replaceSceneContent(SceneCode.BAR_GRAPH_CHOOSER);
|
||||
}
|
||||
|
||||
public void pieGraphButton(){
|
||||
replaceSceneContent(SceneCode.PIE_GRAPH_CHOOSER);
|
||||
}
|
||||
|
||||
public void load() {}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package seng202.group9.GUI;
|
||||
|
||||
import javafx.beans.Observable;
|
||||
import javafx.beans.value.ChangeListener;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.ChoiceBox;
|
||||
import javafx.scene.control.ListView;
|
||||
import javafx.scene.control.SelectionMode;
|
||||
import seng202.group9.Controller.SceneCode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Created by michael on 24/09/2016.
|
||||
*/
|
||||
public class BarChooserController extends Controller{
|
||||
|
||||
@FXML
|
||||
ChoiceBox datatypechooser;
|
||||
@FXML
|
||||
ListView graph_against;
|
||||
@FXML
|
||||
ListView graph_options;
|
||||
|
||||
ObservableList airportOptions = FXCollections.observableArrayList("ID", "Name", "ICAO", "IATA FFA", "Altitude",
|
||||
"Latitude", "Longitude", "City", "Country");
|
||||
|
||||
ObservableList airlineOptions = FXCollections.observableArrayList("ID", "Name", "ICAO", "IATA", "Alias",
|
||||
"Call Sign", "Active", "Country");
|
||||
|
||||
ObservableList routeOptions = FXCollections.observableArrayList("ID", "Stops", "Codeshare", "Equipment", "Airline",
|
||||
"Departure Airport", "Arival airport");
|
||||
|
||||
ArrayList<ObservableList> allOptions = new ArrayList<ObservableList>();
|
||||
|
||||
public void buildGraph() {
|
||||
|
||||
}
|
||||
|
||||
public void returnToSelection(){replaceSceneContent(SceneCode.ANALYSER_TAB);}
|
||||
|
||||
public void changeTables(){
|
||||
int temp = datatypechooser.getSelectionModel().getSelectedIndex();
|
||||
graph_against.setItems(allOptions.get(temp));
|
||||
graph_options.setItems(allOptions.get(temp));
|
||||
}
|
||||
|
||||
public void load(){
|
||||
datatypechooser.setItems(FXCollections.observableArrayList("Airports","Airlines","Routes"));
|
||||
datatypechooser.getSelectionModel().selectFirst();
|
||||
datatypechooser.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>() {
|
||||
public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
|
||||
changeTables();
|
||||
}
|
||||
});
|
||||
graph_against.setItems(airportOptions);
|
||||
graph_options.setItems(airportOptions);
|
||||
graph_options.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
|
||||
allOptions.add(airportOptions);
|
||||
allOptions.add(airlineOptions);
|
||||
allOptions.add(routeOptions);
|
||||
}
|
||||
}
|
||||
@@ -60,6 +60,8 @@ public class MenuController extends Controller{
|
||||
replaceSceneContent(SceneCode.ROUTE_SUMMARY);
|
||||
}
|
||||
|
||||
public void viewAnalyserMain() { replaceSceneContent(SceneCode.ANALYSER_TAB);}
|
||||
|
||||
/**
|
||||
* Load Flight Summary Function.
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package seng202.group9.GUI;
|
||||
|
||||
import javafx.beans.Observable;
|
||||
import javafx.beans.value.ChangeListener;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.ChoiceBox;
|
||||
import javafx.scene.control.ListView;
|
||||
import javafx.scene.control.SelectionMode;
|
||||
import seng202.group9.Controller.SceneCode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Created by michael on 24/09/2016.
|
||||
*/
|
||||
public class PieChooserController extends Controller{
|
||||
|
||||
@FXML
|
||||
ChoiceBox datatypechooser;
|
||||
@FXML
|
||||
ListView graph_options;
|
||||
|
||||
ObservableList airportOptions = FXCollections.observableArrayList("ID", "Name", "ICAO", "IATA FFA", "Altitude",
|
||||
"Latitude", "Longitude", "City", "Country");
|
||||
|
||||
ObservableList airlineOptions = FXCollections.observableArrayList("ID", "Name", "ICAO", "IATA", "Alias",
|
||||
"Call Sign", "Active", "Country");
|
||||
|
||||
ObservableList routeOptions = FXCollections.observableArrayList("ID", "Stops", "Codeshare", "Equipment", "Airline",
|
||||
"Departure Airport", "Arival airport");
|
||||
|
||||
ArrayList<ObservableList> allOptions = new ArrayList<ObservableList>();
|
||||
|
||||
public void buildGraph() {
|
||||
|
||||
}
|
||||
|
||||
public void returnToSelection(){replaceSceneContent(SceneCode.ANALYSER_TAB);}
|
||||
|
||||
public void changeTables(){
|
||||
int temp = datatypechooser.getSelectionModel().getSelectedIndex();
|
||||
graph_options.setItems(allOptions.get(temp));
|
||||
}
|
||||
|
||||
public void load(){
|
||||
datatypechooser.setItems(FXCollections.observableArrayList("Airports","Airlines","Routes"));
|
||||
datatypechooser.getSelectionModel().selectFirst();
|
||||
datatypechooser.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>() {
|
||||
public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
|
||||
changeTables();
|
||||
}
|
||||
});
|
||||
|
||||
graph_options.setItems(airportOptions);
|
||||
allOptions.add(airportOptions);
|
||||
allOptions.add(airlineOptions);
|
||||
allOptions.add(routeOptions);
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,6 @@ public class RouteAnalyser extends Controller {
|
||||
XYChart.Series seriesDeparts = new XYChart.Series();
|
||||
seriesArivals.setName("Arriving routes");
|
||||
seriesDeparts.setName("Departs routes");
|
||||
System.out.println(useddata.keySet().size());
|
||||
for (String airport : useddata.keySet()){
|
||||
ArrayList<Integer> temp = useddata.get(airport);
|
||||
seriesArivals.getData().add(new XYChart.Data(airport,temp.get(0)));
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import java.lang.*?>
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<?import javafx.scene.text.*?>
|
||||
<?import javafx.scene.web.*?>
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.ScrollPane?>
|
||||
<?import javafx.scene.control.TableColumn?>
|
||||
<?import javafx.scene.control.TableView?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.Pane?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
<?import javafx.scene.text.Text?>
|
||||
<?import javafx.scene.web.WebView?>
|
||||
|
||||
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng202.group9.GUI.AnalyserController">
|
||||
<children>
|
||||
<ScrollPane prefHeight="800.0" prefWidth="800.0">
|
||||
<content>
|
||||
<AnchorPane prefHeight="800.0" prefWidth="800.0">
|
||||
<children>
|
||||
<HBox alignment="CENTER" prefHeight="300.0" prefWidth="583.0" AnchorPane.topAnchor="25.0">
|
||||
<children>
|
||||
<AnchorPane prefHeight="300.0" prefWidth="330.0">
|
||||
<children>
|
||||
<Pane layoutY="-6.0" prefHeight="60.0" prefWidth="330.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<children>
|
||||
<Text layoutX="21.0" layoutY="40.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Analyse Data">
|
||||
<font>
|
||||
<Font size="29.0" />
|
||||
</font>
|
||||
</Text>
|
||||
</children>
|
||||
</Pane>
|
||||
<Button layoutX="165.0" layoutY="125.0" mnemonicParsing="false" onAction="#barGraphButton" text="Bar Graph" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
<AnchorPane prefHeight="300.0" prefWidth="253.0">
|
||||
<children>
|
||||
<Pane layoutY="200.0" prefHeight="100.0" prefWidth="253.0">
|
||||
<padding>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</padding>
|
||||
</Pane>
|
||||
<Pane prefHeight="200.0" prefWidth="253.0">
|
||||
<padding>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</padding>
|
||||
<children>
|
||||
<Button layoutX="191.0" layoutY="124.0" mnemonicParsing="false" onAction="#pieGraphButton" text="Pie Graph" />
|
||||
</children>
|
||||
</Pane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</children>
|
||||
</HBox>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</content>
|
||||
</ScrollPane>
|
||||
</children>
|
||||
</VBox>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.ChoiceBox?>
|
||||
<?import javafx.scene.control.ListView?>
|
||||
<?import javafx.scene.control.ScrollPane?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.Pane?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
<?import javafx.scene.text.Text?>
|
||||
|
||||
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8.0.45" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng202.group9.GUI.BarChooserController">
|
||||
<children>
|
||||
<ScrollPane prefHeight="800.0" prefWidth="800.0">
|
||||
<content>
|
||||
<AnchorPane prefHeight="800.0" prefWidth="800.0">
|
||||
<children>
|
||||
<HBox alignment="CENTER" prefHeight="300.0" prefWidth="583.0" AnchorPane.topAnchor="25.0">
|
||||
<children>
|
||||
<AnchorPane prefHeight="300.0" prefWidth="330.0">
|
||||
<children>
|
||||
<Pane layoutY="-6.0" prefHeight="60.0" prefWidth="330.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<children>
|
||||
<Text layoutX="21.0" layoutY="40.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Bar Graph">
|
||||
<font>
|
||||
<Font size="29.0" />
|
||||
</font>
|
||||
</Text>
|
||||
</children>
|
||||
</Pane>
|
||||
<ListView fx:id="graph_against" layoutX="116.0" layoutY="150.0" prefHeight="200.0" prefWidth="200.0" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
<AnchorPane prefHeight="300.0" prefWidth="253.0">
|
||||
<children>
|
||||
<Pane layoutY="200.0" prefHeight="100.0" prefWidth="253.0">
|
||||
<padding>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</padding>
|
||||
<children>
|
||||
<ListView fx:id="graph_options" layoutX="104.0" layoutY="-50.0" prefHeight="200.0" prefWidth="200.0" />
|
||||
</children>
|
||||
</Pane>
|
||||
<Pane prefHeight="200.0" prefWidth="253.0">
|
||||
<padding>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</padding>
|
||||
<children>
|
||||
<ChoiceBox fx:id="datatypechooser" layoutY="14.0" prefWidth="150.0" />
|
||||
</children>
|
||||
</Pane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</children>
|
||||
</HBox>
|
||||
<Button layoutX="244.0" layoutY="400.0" mnemonicParsing="false" onAction="#buildGraph" text="Build Graph" />
|
||||
<Button layoutX="400.0" layoutY="400.0" mnemonicParsing="false" onAction="#returnToSelection" text="Change Graph Type" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</content>
|
||||
</ScrollPane>
|
||||
</children>
|
||||
</VBox>
|
||||
@@ -3,7 +3,6 @@
|
||||
<?import javafx.scene.control.Menu?>
|
||||
<?import javafx.scene.control.MenuBar?>
|
||||
<?import javafx.scene.control.MenuItem?>
|
||||
<?import javafx.scene.control.SeparatorMenuItem?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
|
||||
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.45" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng202.group9.GUI.MenuController">
|
||||
@@ -47,6 +46,7 @@
|
||||
</items></Menu>
|
||||
<Menu mnemonicParsing="false" text="Analysis">
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" onAction="#viewAnalyserMain" text="Graphs" />
|
||||
<MenuItem mnemonicParsing="false" onAction="#veiwDistCalc" text="Calculate distance between Airports" />
|
||||
</items></Menu>
|
||||
</menus>
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.ChoiceBox?>
|
||||
<?import javafx.scene.control.ListView?>
|
||||
<?import javafx.scene.control.ScrollPane?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.Pane?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
<?import javafx.scene.text.Text?>
|
||||
|
||||
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8.0.45" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng202.group9.GUI.PieChooserController">
|
||||
<children>
|
||||
<ScrollPane prefHeight="800.0" prefWidth="800.0">
|
||||
<content>
|
||||
<AnchorPane prefHeight="800.0" prefWidth="800.0">
|
||||
<children>
|
||||
<HBox alignment="CENTER" prefHeight="300.0" prefWidth="583.0" AnchorPane.topAnchor="25.0">
|
||||
<children>
|
||||
<AnchorPane prefHeight="300.0" prefWidth="330.0">
|
||||
<children>
|
||||
<Pane layoutY="-6.0" prefHeight="60.0" prefWidth="330.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<children>
|
||||
<Text layoutX="21.0" layoutY="40.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Pie Graph">
|
||||
<font>
|
||||
<Font size="29.0" />
|
||||
</font>
|
||||
</Text>
|
||||
</children>
|
||||
</Pane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
<AnchorPane prefHeight="300.0" prefWidth="253.0">
|
||||
<children>
|
||||
<Pane layoutY="200.0" prefHeight="100.0" prefWidth="253.0">
|
||||
<padding>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</padding>
|
||||
<children>
|
||||
<ListView fx:id="graph_options" layoutX="-35.0" layoutY="-50.0" prefHeight="200.0" prefWidth="200.0" />
|
||||
</children>
|
||||
</Pane>
|
||||
<Pane prefHeight="200.0" prefWidth="253.0">
|
||||
<padding>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</padding>
|
||||
<children>
|
||||
<ChoiceBox fx:id="datatypechooser" layoutY="14.0" prefWidth="150.0" />
|
||||
</children>
|
||||
</Pane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</children>
|
||||
</HBox>
|
||||
<Button layoutX="234.0" layoutY="413.0" mnemonicParsing="false" onAction="#buildGraph" text="Build Graph" />
|
||||
<Button layoutX="462.0" layoutY="413.0" mnemonicParsing="false" onAction="#returnToSelection" text="Change Graph Type" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</content>
|
||||
</ScrollPane>
|
||||
</children>
|
||||
</VBox>
|
||||
Reference in New Issue
Block a user