Minor bug fixes.

main
Michael 9 years ago
parent 9141f5abf3
commit c0ab798123

@ -36,7 +36,7 @@ public class BarGraphController extends Controller {
public void build_graph(){ public void build_graph(){
//Takes routes from the full dataset. //Takes routes from the full dataset.
current_routes = currentdata.getRoutes(); current_routes = currentdata.getRoutes();
datasetup(current_routes); //datasetup(current_routes);
//Builds series needed for the graph. //Builds series needed for the graph.
XYChart.Series seriesArivals = new XYChart.Series(); XYChart.Series seriesArivals = new XYChart.Series();
XYChart.Series seriesDeparts = new XYChart.Series(); XYChart.Series seriesDeparts = new XYChart.Series();
@ -83,11 +83,11 @@ public class BarGraphController extends Controller {
name = entry.getCountryName(); name = entry.getCountryName();
} }
if (useddata.containsKey(name)){ if (useddata.containsKey(name)){
int temp = useddata.get(name); //int temp = useddata.get(name);
useddata.replace(name,temp+1); //useddata.replace(name,temp+1);
}else { }else {
Integer temp = 1; Integer temp = 1;
useddata.put(name,temp); //useddata.put(name,temp);
} }
} }
} }
@ -95,12 +95,12 @@ public class BarGraphController extends Controller {
private void datasetupCustomRoute(ArrayList<Route> current_routes){ private void datasetupCustomRoute(ArrayList<Route> current_routes){
//Takes out the specified field (Currently departure airport and arrival airport) then adds to the used data dict. //Takes out the specified field (Currently departure airport and arrival airport) then adds to the used data dict.
if(currentsession.getSelectedgraphagainst() = ""){ //if(currentsession.getSelectedgraphagainst() = ""){
} //}
} }
/**
for (Route entry : current_routes){ for (Route entry : current_routes){
String departs = entry.getDepartureAirport(); String departs = entry.getDepartureAirport();
String arives = entry.getArrivalAirport(); String arives = entry.getArrivalAirport();
@ -125,7 +125,7 @@ public class BarGraphController extends Controller {
useddata.put(arives,temp); useddata.put(arives,temp);
} }
} }
*/
/** /**
* Takes the current dataset then loads the data to the graph using build graph. * Takes the current dataset then loads the data to the graph using build graph.
*/ */
@ -161,7 +161,7 @@ public class BarGraphController extends Controller {
else{ else{
d = currentdata.getAirlines(); d = currentdata.getAirlines();
} }
datasetupCustomarAirline(d); //datasetupCustomarAirline(d);
} }
else if (temp == "Routes") { else if (temp == "Routes") {
ArrayList<Route> d = new ArrayList(); ArrayList<Route> d = new ArrayList();

@ -14,7 +14,7 @@ public class PieChartErrorController extends Controller {
} }
public void ignoredWarning() { public void ignoredWarning() {
currentSession.setForceGraph(Boolean.TRUE); currentSession.setForceGraph(true);
replaceSceneContent(SceneCode.AIRPORT_ANALYSER); replaceSceneContent(SceneCode.AIRPORT_ANALYSER);
} }
public void backToSafety(){ public void backToSafety(){

@ -47,7 +47,7 @@ public class PieChooserController extends Controller{
currentsession.setSelectedDataToGraph(datatypechooser.getSelectionModel().getSelectedItem().toString()); currentsession.setSelectedDataToGraph(datatypechooser.getSelectionModel().getSelectedItem().toString());
currentsession.setSelectedgraphagainst(graph_options.getSelectionModel().getSelectedItem().toString()); currentsession.setSelectedgraphagainst(graph_options.getSelectionModel().getSelectedItem().toString());
currentsession.setUsefilter(usefilter.isSelected()); currentsession.setUsefilter(usefilter.isSelected());
currentsession.setForceGraph(Boolean.FALSE); currentsession.setForceGraph(false);
replaceSceneContent(SceneCode.AIRPORT_ANALYSER); replaceSceneContent(SceneCode.AIRPORT_ANALYSER);
} }
@ -64,6 +64,7 @@ public class PieChooserController extends Controller{
changeTables(); changeTables();
} }
}); });
graph_options.setItems(airportOptions); graph_options.setItems(airportOptions);
graph_options.getSelectionModel().selectFirst(); graph_options.getSelectionModel().selectFirst();
allOptions.add(airportOptions); allOptions.add(airportOptions);

@ -44,7 +44,7 @@ public class PieGraphController extends Controller {
pieChartData.add(new PieChart.Data(airport,temp)); pieChartData.add(new PieChart.Data(airport,temp));
} }
//Gives the data to the graph. //Gives the data to the graph.
if (useddata.keySet().size() > 50 && currentsession.getForceGraph()){ if (useddata.keySet().size() > 250 && currentsession.getForceGraph()){
replaceSceneContent(SceneCode.CHART_ERROR); replaceSceneContent(SceneCode.CHART_ERROR);
} }
else{ else{
@ -66,7 +66,7 @@ public class PieGraphController extends Controller {
else if (currentsession.getSelectedgraphagainst() == "ICAO") { else if (currentsession.getSelectedgraphagainst() == "ICAO") {
name = entry.getICAO(); name = entry.getICAO();
} }
else if (currentsession.getSelectedgraphagainst() == "IATA_FFA") { else if (currentsession.getSelectedgraphagainst() == "IATA FFA") {
name = entry.getIATA_FFA(); name = entry.getIATA_FFA();
} }
else if (currentsession.getSelectedgraphagainst() == "City") { else if (currentsession.getSelectedgraphagainst() == "City") {

@ -1,5 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?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.geometry.Insets?> <?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?> <?import javafx.scene.control.Button?>
<?import javafx.scene.control.CheckBox?> <?import javafx.scene.control.CheckBox?>
@ -14,58 +19,47 @@
<?import javafx.scene.text.Font?> <?import javafx.scene.text.Font?>
<?import javafx.scene.text.Text?> <?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"> <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.PieChooserController">
<children> <children>
<ScrollPane prefHeight="800.0" prefWidth="800.0"> <AnchorPane prefHeight="800.0" prefWidth="800.0">
<content> <children>
<AnchorPane prefHeight="800.0" prefWidth="800.0"> <HBox alignment="CENTER" prefHeight="300.0" prefWidth="583.0" AnchorPane.topAnchor="25.0">
<children> <children>
<HBox alignment="CENTER" prefHeight="300.0" prefWidth="583.0" AnchorPane.topAnchor="25.0"> <AnchorPane prefHeight="300.0" prefWidth="330.0">
<children> <children>
<AnchorPane prefHeight="300.0" prefWidth="330.0"> <Pane layoutY="-6.0" prefHeight="60.0" prefWidth="330.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children> <children>
<Pane layoutY="-6.0" prefHeight="60.0" prefWidth="330.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <Text layoutX="21.0" layoutY="40.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Pie Graph">
<children> <font>
<Text layoutX="21.0" layoutY="40.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Pie Graph"> <Font size="29.0" />
<font> </font>
<Font size="29.0" /> </Text>
</font>
</Text>
</children>
</Pane>
</children> </children>
</AnchorPane> </Pane>
<AnchorPane prefHeight="300.0" prefWidth="253.0"> </children>
</AnchorPane>
<AnchorPane prefHeight="300.0" prefWidth="253.0">
<children>
<Pane prefHeight="200.0" prefWidth="253.0">
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</padding>
<children> <children>
<Pane layoutY="200.0" prefHeight="100.0" prefWidth="253.0"> <ChoiceBox fx:id="datatypechooser" layoutY="14.0" prefWidth="150.0" />
<padding> <Label layoutX="-6.0" layoutY="120.0" text="Values to be Graphed." />
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> <Label layoutX="15.0" layoutY="-7.0" text="Data Type Used" />
</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" />
<Label layoutX="-6.0" layoutY="120.0" text="Values to be Graphed." />
<Label layoutX="15.0" layoutY="-7.0" text="Data Type Used" />
</children>
</Pane>
</children> </children>
</AnchorPane> </Pane>
<ListView fx:id="graph_options" layoutY="155.0" prefHeight="200.0" prefWidth="200.0" />
</children> </children>
</HBox> </AnchorPane>
<Button layoutX="234.0" layoutY="413.0" mnemonicParsing="false" onAction="#buildGraph" text="Build Graph" />
<Button layoutX="346.0" layoutY="413.0" mnemonicParsing="false" onAction="#newFilter" text="New Filter" />
<Button layoutX="462.0" layoutY="413.0" mnemonicParsing="false" onAction="#toBarGraphChooser" text="Change Graph Type" />
<CheckBox fx:id="usefilter" layoutX="356.0" layoutY="464.0" mnemonicParsing="false" text="Use filters from Raw Data" />
</children> </children>
</AnchorPane> </HBox>
</content> <Button layoutX="234.0" layoutY="413.0" mnemonicParsing="false" onAction="#buildGraph" text="Build Graph" />
</ScrollPane> <Button layoutX="346.0" layoutY="413.0" mnemonicParsing="false" onAction="#newFilter" text="New Filter" />
<Button layoutX="462.0" layoutY="413.0" mnemonicParsing="false" onAction="#toBarGraphChooser" text="Change Graph Type" />
<CheckBox fx:id="usefilter" layoutX="356.0" layoutY="464.0" mnemonicParsing="false" text="Use filters from Raw Data" />
</children>
</AnchorPane>
</children> </children>
</VBox> </VBox>

Loading…
Cancel
Save