# Conflicts: # res/userdb.dbmain
commit
b7990a3507
Binary file not shown.
@ -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<Dataset> datasetList = observableArrayList();
|
||||
|
||||
public void load() {
|
||||
curDataset = getParent().getCurrentDataset();
|
||||
loadTable();
|
||||
}
|
||||
|
||||
public void loadTable(){
|
||||
ArrayList<Dataset> 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();
|
||||
}
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.text.*?>
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import java.lang.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="598.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8" fx:controller="seng202.group9.GUI.DatasetController">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="517.0" minWidth="10.0" prefWidth="496.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="300.0" minWidth="10.0" prefWidth="104.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="319.0" minHeight="10.0" prefHeight="41.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="319.0" minHeight="10.0" prefHeight="264.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="194.0" minHeight="10.0" prefHeight="40.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="194.0" minHeight="10.0" prefHeight="41.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<ListView fx:id="datasetView" prefHeight="200.0" prefWidth="597.0" GridPane.columnSpan="2" GridPane.rowIndex="1">
|
||||
<contextMenu>
|
||||
<ContextMenu>
|
||||
<items>
|
||||
<MenuItem fx:id="deleteBtn" mnemonicParsing="false" onAction="#deleteDataset" text="Delete Dataset" />
|
||||
</items>
|
||||
</ContextMenu>
|
||||
</contextMenu>
|
||||
</ListView>
|
||||
<TextField fx:id="datasetName" prefHeight="25.0" prefWidth="485.0" promptText="Dataset Name" GridPane.rowIndex="2" />
|
||||
<Button fx:id="addDataset" mnemonicParsing="false" onAction="#addDataset" prefHeight="25.0" prefWidth="84.0" text="Add" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="2" />
|
||||
<Label text="Select or Add a Dataset" GridPane.columnSpan="2" GridPane.halignment="CENTER">
|
||||
<font>
|
||||
<Font size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Button fx:id="openDataset" mnemonicParsing="false" onAction="#openDataset" prefHeight="25.0" prefWidth="785.0" text="Open" GridPane.columnSpan="2" GridPane.halignment="CENTER" GridPane.rowIndex="3" />
|
||||
</children>
|
||||
<padding>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</padding>
|
||||
</GridPane>
|
||||
@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.text.*?>
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import java.lang.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="568.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng202.group9.GUI.GettingStartedController">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="10.0" prefWidth="160.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="160.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="160.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="160.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="160.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="453.0" minHeight="0.0" prefHeight="444.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="505.0" minHeight="10.0" prefHeight="150.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="293.0" minHeight="10.0" prefHeight="100.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<Button mnemonicParsing="false" onAction="#importAirlines" text="Import Airlines" GridPane.halignment="CENTER" GridPane.rowIndex="2">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" />
|
||||
</GridPane.margin>
|
||||
</Button>
|
||||
<Button mnemonicParsing="false" onAction="#importAirports" text="Import Airports" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="2">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" />
|
||||
</GridPane.margin>
|
||||
</Button>
|
||||
<Button mnemonicParsing="false" onAction="#importRoutes" text="Import Routes" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="2">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" />
|
||||
</GridPane.margin>
|
||||
</Button>
|
||||
<Button mnemonicParsing="false" onAction="#importFlightData" text="Import Flights" GridPane.columnIndex="3" GridPane.halignment="CENTER" GridPane.rowIndex="2">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" />
|
||||
</GridPane.margin>
|
||||
</Button>
|
||||
<Label text="Welcome!" GridPane.columnSpan="5" GridPane.halignment="CENTER">
|
||||
<font>
|
||||
<Font size="36.0" />
|
||||
</font>
|
||||
<GridPane.margin>
|
||||
<Insets left="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label prefHeight="31.0" prefWidth="489.0" text="To get started, select which type of data you" GridPane.columnIndex="1" GridPane.columnSpan="3" GridPane.halignment="CENTER" GridPane.rowIndex="1" GridPane.valignment="TOP">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
<font>
|
||||
<Font size="20.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Button mnemonicParsing="false" onAction="#goToAirlineSummary" text="Blank Dataset" GridPane.columnIndex="4" GridPane.halignment="CENTER" GridPane.rowIndex="2">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" />
|
||||
</GridPane.margin>
|
||||
</Button>
|
||||
<Label layoutX="185.0" layoutY="427.0" prefHeight="31.0" prefWidth="489.0" text="wish to import or start from a blank dataset." GridPane.columnIndex="1" GridPane.columnSpan="3" GridPane.halignment="CENTER" GridPane.rowIndex="1" GridPane.valignment="CENTER">
|
||||
<font>
|
||||
<Font size="20.0" />
|
||||
</font>
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" />
|
||||
</GridPane.margin>
|
||||
<padding>
|
||||
<Insets top="15.0" />
|
||||
</padding>
|
||||
</Label>
|
||||
</children>
|
||||
</GridPane>
|
||||
@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.media.*?>
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.text.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import java.lang.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng202.group9.GUI.HelpController">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="286.0" minWidth="10.0" prefWidth="200.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="471.0" minWidth="10.0" prefWidth="400.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="126.0" minHeight="0.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="305.0" minHeight="10.0" prefHeight="289.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<Label text="Help Section" GridPane.columnSpan="2" GridPane.halignment="CENTER">
|
||||
<font>
|
||||
<Font size="24.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<ListView fx:id="listView" onMouseClicked="#sss" prefHeight="303.0" prefWidth="208.0" GridPane.rowIndex="1">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" />
|
||||
</GridPane.margin>
|
||||
</ListView>
|
||||
<ScrollPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="1">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="10.0" right="10.0" />
|
||||
</GridPane.margin>
|
||||
<content>
|
||||
<TextFlow fx:id="textArea" maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="289.0" prefWidth="364.0" textAlignment="JUSTIFY" />
|
||||
</content>
|
||||
</ScrollPane>
|
||||
</children>
|
||||
<padding>
|
||||
<Insets top="10.0" />
|
||||
</padding>
|
||||
</GridPane>
|
||||
Loading…
Reference in new issue