Inital Enter to submit forms
This commit is contained in:
@@ -23,6 +23,8 @@ public class BarChooserController extends Controller{
|
|||||||
@FXML
|
@FXML
|
||||||
ChoiceBox datatypechooser;
|
ChoiceBox datatypechooser;
|
||||||
@FXML
|
@FXML
|
||||||
|
ListView graph_against;
|
||||||
|
@FXML
|
||||||
ListView graph_options;
|
ListView graph_options;
|
||||||
@FXML
|
@FXML
|
||||||
CheckBox usefilter;
|
CheckBox usefilter;
|
||||||
@@ -30,17 +32,18 @@ public class BarChooserController extends Controller{
|
|||||||
ObservableList airportOptions = FXCollections.observableArrayList("Name", "ICAO", "IATA FFA", "Altitude",
|
ObservableList airportOptions = FXCollections.observableArrayList("Name", "ICAO", "IATA FFA", "Altitude",
|
||||||
"City", "Country");
|
"City", "Country");
|
||||||
|
|
||||||
ObservableList airlineOptions = FXCollections.observableArrayList("Name", "ICAO", "IATA", "Alias",
|
ObservableList airlineOptions = FXCollections.observableArrayList("ID", "Name", "ICAO", "IATA", "Alias",
|
||||||
"Call Sign", "Active", "Country");
|
"Call Sign", "Active", "Country");
|
||||||
|
|
||||||
ObservableList routeOptions = FXCollections.observableArrayList("Stops", "Codeshare", "Equipment", "Airline",
|
ObservableList routeOptions = FXCollections.observableArrayList("ID", "Stops", "Codeshare", "Equipment", "Airline",
|
||||||
"Departure Airport", "Arival airport");
|
"Departure Airport", "Arival airport");
|
||||||
|
|
||||||
ArrayList<ObservableList> allOptions = new ArrayList<ObservableList>();
|
ArrayList<ObservableList> allOptions = new ArrayList<ObservableList>();
|
||||||
|
|
||||||
public void buildGraph() {
|
public void buildGraph() {
|
||||||
Session currentsession = this.getParent().getSession();
|
Session currentsession = this.getParent().getSession();
|
||||||
currentsession.setSelectedgraphoptions(graph_options.getSelectionModel().getSelectedItem().toString());
|
currentsession.setSelectedgraphoptions(graph_against.getSelectionModel().getSelectedItem().toString());
|
||||||
|
currentsession.setSelectedgraphagainst(graph_options.getSelectionModel().getSelectedItem().toString());
|
||||||
currentsession.setUsefilter(usefilter.isSelected());
|
currentsession.setUsefilter(usefilter.isSelected());
|
||||||
currentsession.setForceGraph(Boolean.FALSE);
|
currentsession.setForceGraph(Boolean.FALSE);
|
||||||
replaceSceneContent(SceneCode.ROUTE_ANALYSER);
|
replaceSceneContent(SceneCode.ROUTE_ANALYSER);
|
||||||
@@ -50,6 +53,7 @@ public class BarChooserController extends Controller{
|
|||||||
|
|
||||||
public void changeTables(){
|
public void changeTables(){
|
||||||
int temp = datatypechooser.getSelectionModel().getSelectedIndex();
|
int temp = datatypechooser.getSelectionModel().getSelectedIndex();
|
||||||
|
graph_against.setItems(allOptions.get(temp));
|
||||||
graph_options.setItems(allOptions.get(temp));
|
graph_options.setItems(allOptions.get(temp));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,6 +68,8 @@ public class BarChooserController extends Controller{
|
|||||||
changeTables();
|
changeTables();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
graph_against.setItems(airportOptions);
|
||||||
|
graph_against.getSelectionModel().selectFirst();
|
||||||
graph_options.setItems(airportOptions);
|
graph_options.setItems(airportOptions);
|
||||||
graph_options.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
|
graph_options.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
|
||||||
graph_options.getSelectionModel().selectFirst();
|
graph_options.getSelectionModel().selectFirst();
|
||||||
|
|||||||
@@ -1,16 +1,21 @@
|
|||||||
package seng202.group9.GUI;
|
package seng202.group9.GUI;
|
||||||
|
|
||||||
import javafx.collections.FXCollections;
|
import javafx.collections.FXCollections;
|
||||||
|
import javafx.event.EventHandler;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.scene.control.Alert;
|
import javafx.scene.control.Alert;
|
||||||
import javafx.scene.control.Button;
|
import javafx.scene.control.Button;
|
||||||
import javafx.scene.control.TextField;
|
import javafx.scene.control.TextField;
|
||||||
|
import javafx.scene.input.KeyCode;
|
||||||
|
import javafx.scene.input.KeyEvent;
|
||||||
|
import javafx.scene.layout.GridPane;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
import seng202.group9.Controller.Dataset;
|
import seng202.group9.Controller.Dataset;
|
||||||
import seng202.group9.Controller.RouteFilter;
|
import seng202.group9.Controller.RouteFilter;
|
||||||
import seng202.group9.Controller.Session;
|
import seng202.group9.Controller.Session;
|
||||||
import seng202.group9.Core.Route;
|
import seng202.group9.Core.Route;
|
||||||
|
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
@@ -33,6 +38,8 @@ public class RouteFilterController extends Controller {
|
|||||||
private TextField rEquipmentFilter;
|
private TextField rEquipmentFilter;
|
||||||
@FXML
|
@FXML
|
||||||
private Button applyButton;
|
private Button applyButton;
|
||||||
|
@FXML
|
||||||
|
private GridPane airlineAddForm;
|
||||||
|
|
||||||
private Dataset theDataSet = null;
|
private Dataset theDataSet = null;
|
||||||
//Set an empty session to be assigned to the current session.
|
//Set an empty session to be assigned to the current session.
|
||||||
@@ -99,6 +106,14 @@ public class RouteFilterController extends Controller {
|
|||||||
}
|
}
|
||||||
theDataSet = getParent().getCurrentDataset();
|
theDataSet = getParent().getCurrentDataset();
|
||||||
currentSession = getParent().getSession();
|
currentSession = getParent().getSession();
|
||||||
|
airlineAddForm.setOnKeyPressed(new EventHandler<KeyEvent>(){
|
||||||
|
@Override
|
||||||
|
public void handle(KeyEvent event) {
|
||||||
|
if (event.getCode().equals(KeyCode.ENTER)){
|
||||||
|
filterRoutes();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
sesFilter = currentSession.getRouteFilter();
|
sesFilter = currentSession.getRouteFilter();
|
||||||
rAirlineFilter.setText(sesFilter.get("Airline"));
|
rAirlineFilter.setText(sesFilter.get("Airline"));
|
||||||
rSourceFilter.setText(sesFilter.get("Source"));
|
rSourceFilter.setText(sesFilter.get("Source"));
|
||||||
|
|||||||
@@ -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.Label?>
|
<?import javafx.scene.control.Label?>
|
||||||
@@ -9,7 +14,7 @@
|
|||||||
<?import javafx.scene.layout.RowConstraints?>
|
<?import javafx.scene.layout.RowConstraints?>
|
||||||
<?import javafx.scene.text.Font?>
|
<?import javafx.scene.text.Font?>
|
||||||
|
|
||||||
<GridPane hgap="10.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="370.0" prefWidth="600.0" vgap="10.0" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng202.group9.GUI.AirlineAddController">
|
<GridPane fx:id="airlineContainer" hgap="10.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="370.0" prefWidth="600.0" vgap="10.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng202.group9.GUI.AirlineAddController">
|
||||||
<columnConstraints>
|
<columnConstraints>
|
||||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="280.0" minWidth="10.0" prefWidth="125.0" />
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="280.0" minWidth="10.0" prefWidth="125.0" />
|
||||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="515.0" minWidth="10.0" prefWidth="445.0" />
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="515.0" minWidth="10.0" prefWidth="445.0" />
|
||||||
@@ -69,14 +74,38 @@
|
|||||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||||
</GridPane.margin>
|
</GridPane.margin>
|
||||||
</Label>
|
</Label>
|
||||||
<Button fx:id="addButton" mnemonicParsing="false" onAction="#addAirlineSingle" text="Add Airline" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="8" />
|
<Button fx:id="addButton" mnemonicParsing="false" onAction="#addAirlineSingle" text="Add Airline" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="8">
|
||||||
<TextField fx:id="airlNameAdd" prefHeight="31.0" prefWidth="432.0" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="1" />
|
<GridPane.margin>
|
||||||
<TextField fx:id="airlAliasAdd" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="2" />
|
<Insets right="15.0" />
|
||||||
<TextField fx:id="airlIATAAdd" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="3" />
|
</GridPane.margin></Button>
|
||||||
<TextField fx:id="airlICAOAdd" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="4" />
|
<TextField fx:id="airlNameAdd" prefHeight="31.0" prefWidth="432.0" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="1">
|
||||||
<TextField fx:id="airlCallsignAdd" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="5" />
|
<GridPane.margin>
|
||||||
<TextField fx:id="airlCountryAdd" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="6" />
|
<Insets right="15.0" />
|
||||||
<TextField fx:id="airlActiveAdd" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="7" />
|
</GridPane.margin></TextField>
|
||||||
|
<TextField fx:id="airlAliasAdd" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="2">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets right="15.0" />
|
||||||
|
</GridPane.margin></TextField>
|
||||||
|
<TextField fx:id="airlIATAAdd" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="3">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets right="15.0" />
|
||||||
|
</GridPane.margin></TextField>
|
||||||
|
<TextField fx:id="airlICAOAdd" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="4">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets right="15.0" />
|
||||||
|
</GridPane.margin></TextField>
|
||||||
|
<TextField fx:id="airlCallsignAdd" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="5">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets right="15.0" />
|
||||||
|
</GridPane.margin></TextField>
|
||||||
|
<TextField fx:id="airlCountryAdd" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="6">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets right="15.0" />
|
||||||
|
</GridPane.margin></TextField>
|
||||||
|
<TextField fx:id="airlActiveAdd" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="7">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets right="15.0" />
|
||||||
|
</GridPane.margin></TextField>
|
||||||
<Label text="* = required field" GridPane.halignment="LEFT" GridPane.rowIndex="8">
|
<Label text="* = required field" GridPane.halignment="LEFT" GridPane.rowIndex="8">
|
||||||
<GridPane.margin>
|
<GridPane.margin>
|
||||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||||
|
|||||||
Reference in New Issue
Block a user