diff --git a/res/userdb.db b/res/userdb.db index 649a5af..9919893 100644 Binary files a/res/userdb.db and b/res/userdb.db differ diff --git a/src/main/java/seng202/group9/Controller/App.java b/src/main/java/seng202/group9/Controller/App.java index bc481ea..f7f39b2 100644 --- a/src/main/java/seng202/group9/Controller/App.java +++ b/src/main/java/seng202/group9/Controller/App.java @@ -17,6 +17,7 @@ import javafx.scene.control.Menu; import javafx.scene.layout.AnchorPane; import javafx.scene.layout.BorderPane; import javafx.scene.layout.VBox; +import javafx.stage.Modality; import javafx.stage.Stage; import seng202.group9.Core.FlightPath; import seng202.group9.GUI.*; @@ -50,6 +51,23 @@ public class App extends Application @Override public void start(Stage primaryStage) { this.primaryStage = primaryStage; + //after all loading then load the previous session + try{ + FileInputStream fileIn = new FileInputStream("res/session.ser"); + ObjectInputStream objectIn = new ObjectInputStream(fileIn); + session = (Session) objectIn.readObject(); + objectIn.close(); + fileIn.close(); + }catch(IOException e){ + session = new Session(); + System.out.println("New Session File Created"); + }catch(ClassNotFoundException e){ + System.out.println("Missing Session Class"); + System.exit(1); + } catch (Exception e) { + session = new Session(); + e.printStackTrace(); + } //load the menu and the first container try { FXMLLoader loader = new FXMLLoader(); @@ -74,30 +92,23 @@ public class App extends Application } //testing out dataset try { - currentDataset = new Dataset("test's", Dataset.getExisting); + if (session.getCurrentDataset() != null) { + currentDataset = new Dataset(session.getCurrentDataset(), Dataset.getExisting); + }else{ + createPopUpStage(SceneCode.DATASET_CONTROLLER, 600, 400); + } }catch (DataException e){ - e.printStackTrace(); + createPopUpStage(SceneCode.DATASET_CONTROLLER, 600, 400); + }catch (NullPointerException e){ + createPopUpStage(SceneCode.DATASET_CONTROLLER, 600, 400); + }catch (Exception e){ + createPopUpStage(SceneCode.DATASET_CONTROLLER, 600, 400); } //after all loading then load the previous session - try{ - FileInputStream fileIn = new FileInputStream("res/session.ser"); - ObjectInputStream objectIn = new ObjectInputStream(fileIn); - session = (Session) objectIn.readObject(); - Controller controller = (Controller) replaceSceneContent(session.getSceneDisplayed()); - controller.setApp(this); - controller.load(); - controller.loadOnce(); - objectIn.close(); - fileIn.close(); - }catch(IOException e){ - session = new Session(); - System.out.println("New Session File Created"); - }catch(ClassNotFoundException e){ - System.out.println("Missing Session Class"); - System.exit(1); - } catch (Exception e) { - session = new Session(); - e.printStackTrace(); + if (session.getSceneDisplayed() != null) { + menuController.replaceSceneContent(session.getSceneDisplayed()); + }else{ + menuController.replaceSceneContent(SceneCode.INITIAL); } } @@ -197,6 +208,7 @@ public class App extends Application */ public void setCurrentDataset(int index){ currentDataset = datasets.get(index); + session.setCurrentDataset(currentDataset.getName()); } /** @@ -205,6 +217,7 @@ public class App extends Application */ public void setCurrentDataset(Dataset dataset){ currentDataset = dataset; + session.setCurrentDataset(currentDataset.getName()); } /** @@ -241,4 +254,37 @@ public class App extends Application } } } + + public Stage createPopUpStage(SceneCode scene, int width, int height) { + FXMLLoader loader = new FXMLLoader(); + InputStream in = getClass().getClassLoader().getResourceAsStream(scene.getFilePath()); + Parent page = null; + try { + page = loader.load(in); + } catch (IOException e) { + e.printStackTrace(); + } finally { + try { + in.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + //set contorller and call default calls + Controller controller = (Controller) loader.getController(); + controller.setApp(this); + controller.load(); + controller.loadOnce(); + //create a new stage to popup + Stage popupStage = new Stage(); + popupStage.initModality(Modality.WINDOW_MODAL); + //inner layout constraints + VBox container = new VBox(); + container.getChildren().add(page); + Scene popupScene = new Scene(container, width, height); + //show + popupStage.setScene(popupScene); + popupStage.showAndWait(); + return popupStage; + } } diff --git a/src/main/java/seng202/group9/Controller/Dataset.java b/src/main/java/seng202/group9/Controller/Dataset.java index 6fcf2ff..5704540 100644 --- a/src/main/java/seng202/group9/Controller/Dataset.java +++ b/src/main/java/seng202/group9/Controller/Dataset.java @@ -697,7 +697,7 @@ public class Dataset { flightPathToAdd.setID(flightPathId); String insertFlightPointQuery = "INSERT INTO `" + this.name + "_Flight_Points` (`Index_ID`, `Name`, `Type`," + - " `Altitude`, `Latitude`, `Longitude`) VALUES "; + " `Altitude`, `Latitude`, `Longitude`, `Order`) VALUES "; int numOfFlights = 0; for (int i = 0; i < flightPointsToImport.size(); i ++){ String flightPointIdentifier = flightPointsToImport.get(i).getType() + flightPointsToImport.get(i).getName() + @@ -714,7 +714,7 @@ public class Dataset { insertFlightPointQuery += ","; } insertFlightPointQuery += "(" + flightPathId +", \""+ flightName +"\", \"" + flightType + "\", "+ flightAltitude + ", " + - "" + flightLatitude + ", " + flightLongitude + ")"; + "" + flightLatitude + ", " + flightLongitude + ", "+numOfFlights+")"; flightPointsToImport.get(i).setID(nextID); flightPointsToImport.get(i).setIndexID(flightPathId); //add data to dataset array. @@ -1239,12 +1239,12 @@ public class Dataset { stmt = c.createStatement(); String insertFlightPointQuery = "INSERT INTO `" + this.name + "_Flight_Points` (`Index_ID`, `Name`, `Type`," + - " `Altitude`, `Latitude`, `Longitude`, `Heading`, `Tot_Dist`, `Leg_Dist`, `Via`) VALUES "; + " `Altitude`, `Latitude`, `Longitude`, `Heading`, `Tot_Dist`, `Leg_Dist`, `Via`, `Order`) VALUES "; String flightType = type.replace("\"", "\"\""); String flightName = name.replace("\"", "\"\""); insertFlightPointQuery += "(" + id +", \""+ flightName +"\", \"" + flightType + "\", "+ altitudeVal + ", " + "" + latitudeVal + ", " + longitudeVal + ", " + headingVal + ", " + totalDistVal + ", " + legDistVal + - ", \"" + via + "\")"; + ", \"" + via + "\", "+index+")"; stmt.execute(insertFlightPointQuery); stmt.close(); //move all the points after this forward @@ -1263,7 +1263,6 @@ public class Dataset { String query = "UPDATE `"+this.name+"_Flight_Path` SET `Source_Airport` = \""+flightName+"\" " + "WHERE `Path_ID` = "+flightPath.getID(); stmt.execute(query); - c.close(); } catch ( Exception e ) { System.err.println( e.getClass().getName() + ": " + e.getMessage() ); } @@ -1274,7 +1273,6 @@ public class Dataset { String query = "UPDATE `"+this.name+"_Flight_Path` SET `Destination_Airport` = \""+flightName+"\" " + "WHERE `Path_ID` = "+flightPath.getID(); stmt.execute(query); - c.close(); } catch ( Exception e ) { System.err.println( e.getClass().getName() + ": " + e.getMessage() ); } @@ -2115,7 +2113,7 @@ public class Dataset { } stmt.close(); - if (index == 0){ + if (index == 0 || curIndex == 0){ try { stmt = c.createStatement(); String query = "UPDATE `"+this.name+"_Flight_Path` SET `Source_Airport` = \""+flightPoint.getName().replace("\"", "\"\"")+"\" " + @@ -2126,7 +2124,7 @@ public class Dataset { System.err.println( e.getClass().getName() + ": " + e.getMessage() ); } flightPath.setDepartureAirport(flightPoint.getName()); - }else if (index == flightPath.getFlightPoints().size() - 1){ + }else if (index == flightPath.getFlightPoints().size() - 1 || curIndex == flightPath.getFlightPoints().size() - 1){ try { stmt = c.createStatement(); String query = "UPDATE `"+this.name+"_Flight_Path` SET `Destination_Airport` = \""+flightPoint.getName().replace("\"", "\"\"")+"\" " + @@ -2172,4 +2170,12 @@ public class Dataset { System.exit(0); } } + + /** + * Name of the dataset in the database + */ + @Override + public String toString(){ + return this.name; + } } diff --git a/src/main/java/seng202/group9/Controller/SceneCode.java b/src/main/java/seng202/group9/Controller/SceneCode.java index eb6844b..cdbd254 100644 --- a/src/main/java/seng202/group9/Controller/SceneCode.java +++ b/src/main/java/seng202/group9/Controller/SceneCode.java @@ -5,14 +5,14 @@ package seng202.group9.Controller; * SceneCode enum is used for Serialization of sessions as well as changing the GUI state from one to the other. */ public enum SceneCode { - INITIAL(""), AIRLINE_SUMMARY("airline_summary.fxml"), AIRLINE_RAW_DATA("airline_raw_data.fxml"), + INITIAL("getting_started.fxml"), AIRLINE_SUMMARY("airline_summary.fxml"), AIRLINE_RAW_DATA("airline_raw_data.fxml"), AIRPORT_SUMMARY("airport_summary.fxml"), AIRPORT_RAW_DATA("airport_raw_data.fxml"), ROUTE_SUMMARY("routes_summary.fxml"), ROUTE_RAW_DATA("route_raw_data.fxml"), FLIGHT_SUMMARY("flight_data_summary.fxml"), 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"), AIRLINE_EDIT("airline_edit_form.fxml"), AIRPORT_EDIT("airport_edit_form.fxml"), - ROUTE_EDIT("route_edit_form.fxml"), FLIGHT_EDITOR("flight_editor_form.fxml"); + ROUTE_EDIT("route_edit_form.fxml"), FLIGHT_EDITOR("flight_editor_form.fxml"), DATASET_CONTROLLER("dataset_editor.fxml"), HELP("help.fxml"); private String filePath; diff --git a/src/main/java/seng202/group9/Controller/Session.java b/src/main/java/seng202/group9/Controller/Session.java index 71a3dc5..f14787c 100644 --- a/src/main/java/seng202/group9/Controller/Session.java +++ b/src/main/java/seng202/group9/Controller/Session.java @@ -25,6 +25,8 @@ public class Session implements Serializable { private String airportToEdit; private String routeToEdit; + private String currentDataset; + /** * Constructor for a new session @@ -42,6 +44,14 @@ public class Session implements Serializable { this.sceneDisplayed = scene; } + public String getCurrentDataset(){ + return this.currentDataset; + } + + public void setCurrentDataset(String currentDataset){ + this.currentDataset = currentDataset; + } + /** * changes the serialized scene. * @param sceneDisplayed diff --git a/src/main/java/seng202/group9/GUI/AirlineRDController.java b/src/main/java/seng202/group9/GUI/AirlineRDController.java index 475b392..52a1df4 100644 --- a/src/main/java/seng202/group9/GUI/AirlineRDController.java +++ b/src/main/java/seng202/group9/GUI/AirlineRDController.java @@ -81,17 +81,11 @@ public class AirlineRDController extends Controller { */ public void openFilter() { createPopUpStage(SceneCode.AIRLINE_FILTER, 600, 370); - - if (currentSession.getFilteredAirlines() != null) { - ArrayList d = new ArrayList(); - for (int i = 0; i < theDataSet.getAirlines().size(); i++) { - if (currentSession.getFilteredAirlines().containsValue(theDataSet.getAirlines().get(i).getName()) - && currentSession.getFilteredAirlines().containsKey(i)) { - d.add(theDataSet.getAirlines().get(i)); - } - } - tableViewAirlineRD.setItems(FXCollections.observableArrayList(d)); + ArrayList d = new ArrayList(); + for (int key: currentSession.getFilteredAirlines().keySet()){ + d.add(theDataSet.getAirlineDictionary().get(currentSession.getFilteredAirlines().get(key))); } + tableViewAirlineRD.setItems(FXCollections.observableArrayList(d)); } diff --git a/src/main/java/seng202/group9/GUI/AirportRDController.java b/src/main/java/seng202/group9/GUI/AirportRDController.java index dfd1bf7..3661e15 100644 --- a/src/main/java/seng202/group9/GUI/AirportRDController.java +++ b/src/main/java/seng202/group9/GUI/AirportRDController.java @@ -88,17 +88,11 @@ public class AirportRDController extends Controller{ public void openFilter() { createPopUpStage(SceneCode.AIRPORT_FILTER, 600, 480); - - if (currentSession.getFilteredAirports() != null) { - ArrayList d = new ArrayList(); - for (int i = 0; i < theDataSet.getAirports().size(); i++) { - if (currentSession.getFilteredAirports().containsValue(theDataSet.getAirports().get(i).getName()) - && currentSession.getFilteredAirports().containsKey(i)) { - d.add(theDataSet.getAirports().get(i)); - } - } - tableViewAirportRD.setItems(FXCollections.observableArrayList(d)); + ArrayList d = new ArrayList(); + for (int key: currentSession.getFilteredAirports().keySet()){ + d.add(theDataSet.getAirportDictionary().get(currentSession.getFilteredAirports().get(key))); } + tableViewAirportRD.setItems(FXCollections.observableArrayList(d)); } /** diff --git a/src/main/java/seng202/group9/GUI/DatasetController.java b/src/main/java/seng202/group9/GUI/DatasetController.java new file mode 100644 index 0000000..3215abf --- /dev/null +++ b/src/main/java/seng202/group9/GUI/DatasetController.java @@ -0,0 +1,79 @@ +package seng202.group9.GUI; + +import javafx.beans.InvalidationListener; +import javafx.collections.FXCollections; +import javafx.collections.ListChangeListener; +import javafx.collections.ObservableList; +import javafx.fxml.FXML; +import javafx.scene.control.Alert; +import javafx.scene.control.Button; +import javafx.scene.control.ListView; +import javafx.scene.control.TextField; +import javafx.stage.Stage; +import seng202.group9.Controller.DataException; +import seng202.group9.Controller.Dataset; + +import java.util.*; + +import static javafx.collections.FXCollections.observableArrayList; + +/** + * Created by fwy13 on 30/09/16. + */ +public class DatasetController extends Controller{ + + @FXML + ListView datasetView; + @FXML + TextField datasetName; + @FXML + Button openDataset; + Dataset curDataset = null; + ObservableList datasetList = observableArrayList(); + + public void load() { + curDataset = getParent().getCurrentDataset(); + loadTable(); + } + + public void loadTable(){ + ArrayList datasets = getParent().getDatasets(); + datasetList = observableArrayList(datasets); + datasetView.setItems(datasetList); + } + + public void deleteDataset(){ + Dataset datasetToDelete = (Dataset) datasetView.getSelectionModel().getSelectedItem(); + getParent().deleteDataset(datasetToDelete); + loadTable(); + } + + public void addDataset(){ + String name = datasetName.getText(); + if (!name.equals("") && name != null) { + try { + getParent().createDataset(name); + } catch (DataException e) { + Alert alert = new Alert(Alert.AlertType.ERROR); + alert.setTitle("Dataset Creation Error"); + alert.setHeaderText("Error creating Dataset."); + alert.setContentText(e.getMessage()); + alert.showAndWait(); + } + }else{ + Alert alert = new Alert(Alert.AlertType.ERROR); + alert.setTitle("Dataset Creation Error"); + alert.setHeaderText("Error creating Dataset."); + alert.setContentText("Dataset Name Cannot be Empty"); + alert.showAndWait(); + } + loadTable(); + } + + public void openDataset(){ + Dataset datasetToOpen = (Dataset) datasetView.getSelectionModel().getSelectedItem(); + getParent().setCurrentDataset(datasetToOpen); + loadTable(); + ((Stage) openDataset.getScene().getWindow()).close(); + } +} diff --git a/src/main/java/seng202/group9/GUI/GettingStartedController.java b/src/main/java/seng202/group9/GUI/GettingStartedController.java new file mode 100644 index 0000000..c241f96 --- /dev/null +++ b/src/main/java/seng202/group9/GUI/GettingStartedController.java @@ -0,0 +1,33 @@ +package seng202.group9.GUI; + +import seng202.group9.Controller.SceneCode; + +/** + * Created by spe76 on 26/09/16. + */ +public class GettingStartedController extends Controller { + + public void load() { + + } + + public void importAirlines() { + Importer importer = new Importer(SceneCode.AIRLINE_RAW_DATA, getParent(), getParent().getPrimaryStage()); + } + + public void importAirports() { + Importer importer = new Importer(SceneCode.AIRPORT_RAW_DATA, getParent(), getParent().getPrimaryStage()); + } + + public void importRoutes() { + Importer importer = new Importer(SceneCode.ROUTE_RAW_DATA, getParent(), getParent().getPrimaryStage()); + } + + public void importFlightData() { + Importer importer = new Importer(SceneCode.FLIGHT_RAW_DATA, getParent(), getParent().getPrimaryStage()); + } + + public void goToAirlineSummary() { + replaceSceneContent(SceneCode.AIRLINE_SUMMARY); + } +} diff --git a/src/main/java/seng202/group9/GUI/HelpController.java b/src/main/java/seng202/group9/GUI/HelpController.java new file mode 100644 index 0000000..226eff6 --- /dev/null +++ b/src/main/java/seng202/group9/GUI/HelpController.java @@ -0,0 +1,78 @@ +package seng202.group9.GUI; + +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; +import javafx.fxml.FXML; +import javafx.scene.control.ListView; +import javafx.scene.control.TextArea; +import javafx.scene.layout.Pane; +import javafx.scene.text.Text; +import javafx.scene.text.TextFlow; + +/** + * Created by spe76 on 30/09/16. + */ +public class HelpController extends Controller { + @FXML + private ListView listView; + @FXML + private TextFlow textArea; + + public static final ObservableList menu = FXCollections.observableArrayList(); + Text text = new Text(); + + public void load() { + menu.addAll("Importing Data", "Viewing Data", "Manipulating Data", "Analysis"); + + text = new Text("Please select an option on the left side menu to display its contents."); + textArea.getChildren().add(text); + + listView.setItems(menu); + } + + public void sss() { + String menuValue = listView.getSelectionModel().getSelectedItem().toString(); + textArea.getChildren().clear(); + if (menuValue == "Importing Data") { + text = new Text("You can import data from the first start up of the application and " + + "from the 'File' menu on the top of the screen.\nTo import data, select the type " + + "of data you wish to import. Then select the file (.csv and .txt file) from the " + + "file selector. The data will be loaded into the program and taken to the " + + "corresponding summary page."); + textArea.getChildren().add(text); + } else if (menuValue == "Viewing Data") { + text = new Text("There are two types of views available: Summary view and Raw Data view. " + + "These are accessable from the menu on the top of the screen under the " + + "'View' tab. You first choose which set of data you want to view and then you can select" + + " either 'Summary' or 'Raw Data'.\n" + + "The summary view does not have every column but provides a map of where the " + + "place is.\nThe raw data view allows the user to view the full data table."); + textArea.getChildren().add(text); + } else if (menuValue == "Manipulating Data") { + text = new Text("Data manipulation is all available in the Raw Data views. There are four " + + "ways to manipulate data: 'Add', 'Filter', 'Edit' and 'Delete'.\n" + + "Add: To add a new entry, first go to the raw data view for that data type. Then click " + + "on the add button located on the bottom of the page. Then fill out the entries in the " + + "pop-up box and click add at the bottom of the screen. If there is an error with your entry, " + + "a message will pop up to help you.\n" + + "Filter: To filter all current entries, click on the filter option and a pop " + + "up will appear. Then type in the fields you wish to filter by and press the filter button. " + + "The table should update with the fields specified.\n" + + "Edit: The edit function can be accessed by right clicking on the entry you wish to edit and" + + " clicking the edit option. This will lead to a pop up where you can edit the current entry. " + + " When the edit has been completed, you can press the apply button on the bottom of the pop up. " + + "Again, when the program detects an invalid field, a message will pop up.\n" + + "Delete: The delete function is also accessed by right clicking an entry and pressing the delete field. " + + "This will come up with a pop up to confirm your delete. When you press ok, the entry will be deleted " + + "from the program. The program also allows multiple deletes."); + textArea.getChildren().add(text); + } else if (menuValue == "Analysis") { + text = new Text("There are two ways to do analysis.\nThe first method is to go to the raw data page and " + + "press analyse. This will come up with specific graphs that are related to the set of data." + + "\nThe second method is by accessing the 'Analysis' button on the menu on the top of the page. " + + "You can select which type of analysis you want from here."); + textArea.getChildren().add(text); + } + } + +} \ No newline at end of file diff --git a/src/main/java/seng202/group9/GUI/MenuController.java b/src/main/java/seng202/group9/GUI/MenuController.java index f530c9e..3bbbaea 100644 --- a/src/main/java/seng202/group9/GUI/MenuController.java +++ b/src/main/java/seng202/group9/GUI/MenuController.java @@ -74,6 +74,14 @@ public class MenuController extends Controller{ replaceSceneContent(SceneCode.FLIGHT_RAW_DATA); } + public void goToGettingStarted() { + replaceSceneContent(SceneCode.INITIAL); + } + + public void goToHelp() { + createPopUpStage(SceneCode.HELP, 600, 400); + } + public void load() { //nothing to load } diff --git a/src/main/java/seng202/group9/GUI/RouteFilterController.java b/src/main/java/seng202/group9/GUI/RouteFilterController.java index dc47ecd..a1afa28 100644 --- a/src/main/java/seng202/group9/GUI/RouteFilterController.java +++ b/src/main/java/seng202/group9/GUI/RouteFilterController.java @@ -72,11 +72,12 @@ public class RouteFilterController extends Controller { alert.showAndWait(); //currentSession.setFilteredAirlines(FXCollections.observableArrayList(filter.getFilteredData())); - + //routeAirline + routeSourceAirport + routeArrvAirport + routeCodeShare + routeStops + routeEquip HashMap routesHM = new HashMap(); ArrayList routes = filter.getFilteredData(); for (int index = 0; index < routes.size(); index++) { - routesHM.put(index, routes.get(index).getAirlineName()); + routesHM.put(index, routes.get(index).getAirlineName() + routes.get(index).getDepartureAirport() + routes.get(index).getArrivalAirport() + + routes.get(index).getCode() + routes.get(index).getStops() + routes.get(index).getEquipment()); } currentSession.setFilteredRoutes(routesHM); diff --git a/src/main/java/seng202/group9/GUI/RouteRDController.java b/src/main/java/seng202/group9/GUI/RouteRDController.java index 69b20c6..c05e784 100644 --- a/src/main/java/seng202/group9/GUI/RouteRDController.java +++ b/src/main/java/seng202/group9/GUI/RouteRDController.java @@ -78,16 +78,12 @@ public class RouteRDController extends Controller { public void openFilter() { createPopUpStage(SceneCode.ROUTE_FILTER, 600, 330); - if (currentSession.getFilteredRoutes() != null) { - ArrayList d = new ArrayList(); - for (int i = 0; i < theDataSet.getRoutes().size(); i++) { - if (currentSession.getFilteredRoutes().containsValue(theDataSet.getRoutes().get(i).getAirlineName()) - && currentSession.getFilteredRoutes().containsKey(i)) { - d.add(theDataSet.getRoutes().get(i)); - } - } - tableViewRouteRD.setItems(FXCollections.observableArrayList(d)); + + ArrayList d = new ArrayList(); + for (int key: currentSession.getFilteredRoutes().keySet()){ + d.add(theDataSet.getRouteDictionary().get(currentSession.getFilteredRoutes().get(key))); } + tableViewRouteRD.setItems(FXCollections.observableArrayList(d)); } /** diff --git a/src/main/resources/dataset_editor.fxml b/src/main/resources/dataset_editor.fxml new file mode 100644 index 0000000..a43b40c --- /dev/null +++ b/src/main/resources/dataset_editor.fxml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/help.fxml b/src/main/resources/help.fxml new file mode 100644 index 0000000..6f1d0bd --- /dev/null +++ b/src/main/resources/help.fxml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/menu.fxml b/src/main/resources/menu.fxml index e6d61d5..cb7dd6d 100644 --- a/src/main/resources/menu.fxml +++ b/src/main/resources/menu.fxml @@ -1,12 +1,15 @@ + + + - + @@ -49,6 +52,12 @@ + + + + + + diff --git a/src/main/resources/route_raw_data.fxml b/src/main/resources/route_raw_data.fxml index 80775bf..3a7a3ce 100644 --- a/src/main/resources/route_raw_data.fxml +++ b/src/main/resources/route_raw_data.fxml @@ -1,5 +1,10 @@ + + + + + @@ -13,7 +18,7 @@ - + @@ -80,5 +85,18 @@ + + diff --git a/src/test/java/seng202/group9/FilterUnitTest.java b/src/test/java/seng202/group9/FilterUnitTest.java index 44a3c5a..9adf431 100644 --- a/src/test/java/seng202/group9/FilterUnitTest.java +++ b/src/test/java/seng202/group9/FilterUnitTest.java @@ -31,6 +31,10 @@ public class FilterUnitTest { int size = airlineFilter.getFilteredData().size(); + airlineFilter.filterCountry("New Zealand"); + assertTrue(airlineFilter.getFilteredData().size() == 25); + airlineFilter.reset(); + airlineFilter.filterActive("Y"); assertTrue(size != airlineFilter.getFilteredData().size());