Merge remote-tracking branch 'origin/master'

This commit is contained in:
law39 2020-04-30 15:58:42 +01:00
commit a04d40af17
5 changed files with 224 additions and 177 deletions

View file

@ -1,3 +1,10 @@
/**
* @(#) AddWordController.java 0,1 2020/04/30
* <p>
* Copyright (c) 2020 Aberystwyth University.
* All rights reserved.
*/
package uk.ac.aber.cs22120.group20.javafx; package uk.ac.aber.cs22120.group20.javafx;
import javafx.event.ActionEvent; import javafx.event.ActionEvent;
@ -14,9 +21,21 @@ import uk.ac.aber.cs22120.group20.json.DictionaryEntry;
/** /**
* Add Word Controller * A class that handles the keyboard and mouse input and interaction for the 'Add Word Page' which is
* defined by 'addword.fxml'
*
* @author Brad Corbett [brc9]
* @author Henry Dugmore [hjd3]
* @author Kain Bryan-Jones [kab74]
* @author Luke Wybar [law39]
* @author Marcin Jakob [maj83]
* @author Oscar Pocock [osp1]
* @author Tom Perry [top1]
* @author Waylen Watts [ncw]
* @version 0.1 Initial development.
* @see DictionaryEntry
* @see Application
*/ */
public class AddWordController extends SharedCodeController { public class AddWordController extends SharedCodeController {
@FXML @FXML
@ -26,10 +45,22 @@ public class AddWordController extends SharedCodeController {
@FXML @FXML
private ComboBox<String> wordType; private ComboBox<String> wordType;
/**
* Gets the value from the welsh text field
*
* @return welsh
*/
public TextField getWelsh() { public TextField getWelsh() {
return welsh; return welsh;
} }
/**
* Gets the value from the english text field
*
* @return english
*/
public TextField getEnglish() { public TextField getEnglish() {
return english; return english;
} }
@ -48,6 +79,13 @@ public class AddWordController extends SharedCodeController {
} }
/**
* Method that runs when you click the add word button
*
* @param actionEvent action event for the button click
* @see Application
* @see DictionaryEntry
*/
@FXML @FXML
protected void addButtonClick(ActionEvent actionEvent) { protected void addButtonClick(ActionEvent actionEvent) {
@ -62,7 +100,7 @@ public class AddWordController extends SharedCodeController {
trueWordType = DictionaryEntry.wordTypeEnum.other; trueWordType = DictionaryEntry.wordTypeEnum.other;
} }
boolean entryFound = false; boolean entryFound = false;
// one or more blank fields // test for one or more blank fields and if there is create the correct error dialogue box
if (english.getText() == null || welsh.getText() == null || wordType.getValue().equals("Type")) { if (english.getText() == null || welsh.getText() == null || wordType.getValue().equals("Type")) {
Alert error = new Alert(Alert.AlertType.ERROR); Alert error = new Alert(Alert.AlertType.ERROR);
error.setTitle("Error"); error.setTitle("Error");
@ -72,6 +110,7 @@ public class AddWordController extends SharedCodeController {
error.showAndWait(); error.showAndWait();
} else { } else {
for (DictionaryEntry entry : Application.dictionary) { for (DictionaryEntry entry : Application.dictionary) {
//test if the entry exists in the dictionary and if it does create the correct error dialogue box
entryFound = false; entryFound = false;
DictionaryEntry newEntry = new DictionaryEntry(english.getText(), welsh.getText(), trueWordType); DictionaryEntry newEntry = new DictionaryEntry(english.getText(), welsh.getText(), trueWordType);
if (entry.equals(newEntry)) { if (entry.equals(newEntry)) {
@ -88,6 +127,7 @@ public class AddWordController extends SharedCodeController {
} }
} }
if (!entryFound) { if (!entryFound) {
//if everything is fine, save the entered values as a dictionary entry in the dictionary
Alert alert = new Alert(Alert.AlertType.INFORMATION); Alert alert = new Alert(Alert.AlertType.INFORMATION);
alert.setTitle("Success"); alert.setTitle("Success");
alert.setHeaderText("Entry Saved"); alert.setHeaderText("Entry Saved");
@ -102,12 +142,8 @@ public class AddWordController extends SharedCodeController {
Application.dictionary.add(dictionaryEntry); Application.dictionary.add(dictionaryEntry);
Application.practiceList.add(dictionaryEntry); Application.practiceList.add(dictionaryEntry);
// output of what was saved for testing
// System.out.print(english.getText());
// System.out.print(welsh.getText());
// System.out.println(wordType.getValue());
// Resets values to blank for next word to be entered //Resets values to blank for next word to be entered
english.clear(); english.clear();
welsh.clear(); welsh.clear();
wordType.setValue("Type"); wordType.setValue("Type");
@ -120,42 +156,83 @@ public class AddWordController extends SharedCodeController {
} }
// @Override
// public boolean equals(Object obj) {
// DictionaryEntry otherObject = (DictionaryEntry) obj;
// return (this.getEnglish().equals(otherObject.getEnglish()) && this.getWelsh().equals(otherObject.getWelsh()));
// }
/**
* Method that adds ch to the welsh text field and runs when the user clicks the ch button on the add word screen
*
* @param actionEvent action event for the button click
*/
// add character methods for characters ch, dd, ff, ng, ll, ph, rh, th // add character methods for characters ch, dd, ff, ng, ll, ph, rh, th
public void addCharch(ActionEvent actionEvent) { public void addCharch(ActionEvent actionEvent) {
welsh.appendText("ch"); welsh.appendText("ch");
} }
/**
* Method that adds dd to the welsh text field and runs when the user clicks the dd button on the add word screen *
*
* @param actionEvent action event for the button click
*/
public void addChardd(ActionEvent actionEvent) { public void addChardd(ActionEvent actionEvent) {
welsh.appendText("dd"); welsh.appendText("dd");
} }
/**
* Method that adds ff to the welsh text field and runs when the user clicks the ff button on the add word screen
*
* @param actionEvent action event for the button click
*/
public void addCharff(ActionEvent actionEvent) { public void addCharff(ActionEvent actionEvent) {
welsh.appendText("ff"); welsh.appendText("ff");
} }
/**
* Method that adds ng to the welsh text field and runs when the user clicks the ng button on the add word screen
*
* @param actionEvent action event for the button click
*/
public void addCharng(ActionEvent actionEvent) { public void addCharng(ActionEvent actionEvent) {
welsh.appendText("ng"); welsh.appendText("ng");
} }
/**
* Method that adds ll to the welsh text field and runs when the user clicks the ll button on the add word screen
*
* @param actionEvent action event for the button click
*/
public void addCharll(ActionEvent actionEvent) { public void addCharll(ActionEvent actionEvent) {
welsh.appendText("ll"); welsh.appendText("ll");
} }
/**
* Method that adds ph to the welsh text field and runs when the user clicks the ph button on the add word screen
*
* @param actionEvent action event for the button click
*/
public void addCharph(ActionEvent actionEvent) { public void addCharph(ActionEvent actionEvent) {
welsh.appendText("ph"); welsh.appendText("ph");
} }
/**
* Method that adds rh to the welsh text field and runs when the user clicks the rh button on the add word screen
*
* @param actionEvent action event for the button click
*/
public void addCharrh(ActionEvent actionEvent) { public void addCharrh(ActionEvent actionEvent) {
welsh.appendText("rh"); welsh.appendText("rh");
} }
/**
* Method that adds th to the welsh text field and runs when the user clicks the th button on the add word screen
*
* @param actionEvent action event for the button click
*/
public void addCharth(ActionEvent actionEvent) { public void addCharth(ActionEvent actionEvent) {
welsh.appendText("th"); welsh.appendText("th");
} }

View file

@ -16,7 +16,7 @@
<?import javafx.scene.text.Font?> <?import javafx.scene.text.Font?>
<?import javafx.scene.text.Text?> <?import javafx.scene.text.Text?>
<BorderPane fx:id="container" minHeight="550" minWidth="500" stylesheets="" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="uk.ac.aber.cs22120.group20.javafx.AddWordController"> <BorderPane minHeight="550" minWidth="500" stylesheets="" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="uk.ac.aber.cs22120.group20.javafx.AddWordController">
<left> <left>
@ -139,7 +139,6 @@
<RowConstraints maxHeight="133.0" minHeight="10.0" prefHeight="28.999979654947936" vgrow="SOMETIMES" /> <RowConstraints maxHeight="133.0" minHeight="10.0" prefHeight="28.999979654947936" vgrow="SOMETIMES" />
<RowConstraints maxHeight="129.33331298828125" minHeight="10.0" prefHeight="129.33331298828125" vgrow="SOMETIMES" /> <RowConstraints maxHeight="129.33331298828125" minHeight="10.0" prefHeight="129.33331298828125" vgrow="SOMETIMES" />
</rowConstraints> </rowConstraints>
<children>
<Label alignment="CENTER" prefHeight="17.0" prefWidth="105.0" text="English" GridPane.columnIndex="1" GridPane.rowIndex="2" /> <Label alignment="CENTER" prefHeight="17.0" prefWidth="105.0" text="English" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label alignment="CENTER" prefHeight="17.0" prefWidth="105.0" text="Welsh" GridPane.columnIndex="5" GridPane.rowIndex="2" /> <Label alignment="CENTER" prefHeight="17.0" prefWidth="105.0" text="Welsh" GridPane.columnIndex="5" GridPane.rowIndex="2" />
<ComboBox fx:id="wordType" prefHeight="25.0" prefWidth="275.0" promptText="Type" GridPane.columnIndex="3" GridPane.rowIndex="3" /> <ComboBox fx:id="wordType" prefHeight="25.0" prefWidth="275.0" promptText="Type" GridPane.columnIndex="3" GridPane.rowIndex="3" />
@ -160,7 +159,7 @@
<rowConstraints> <rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints> </rowConstraints>
<children>
<Button maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#addCharch" text="ch" /> <Button maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#addCharch" text="ch" />
<Button maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#addChardd" text="dd" GridPane.columnIndex="1" /> <Button maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#addChardd" text="dd" GridPane.columnIndex="1" />
<Button maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#addCharff" text="ff" GridPane.columnIndex="2" /> <Button maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#addCharff" text="ff" GridPane.columnIndex="2" />
@ -169,9 +168,9 @@
<Button maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#addCharph" text="ph" GridPane.columnIndex="5" /> <Button maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#addCharph" text="ph" GridPane.columnIndex="5" />
<Button maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#addCharrh" text="rh" GridPane.columnIndex="6" /> <Button maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#addCharrh" text="rh" GridPane.columnIndex="6" />
<Button maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#addCharth" text="th" GridPane.columnIndex="7" /> <Button maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#addCharth" text="th" GridPane.columnIndex="7" />
</children>
</GridPane> </GridPane>
</children>
</GridPane> </GridPane>
</center> </center>

View file

@ -1,27 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?> <?import javafx.scene.control.Label?>
<?import javafx.scene.control.TableColumn?> <?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?> <?import javafx.scene.control.TableView?>
<?import javafx.scene.control.TextField?> <?import javafx.scene.control.TextField?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?> <?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?> <?import javafx.scene.text.Font?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<?import javafx.scene.shape.Rectangle?> <?import javafx.scene.shape.Rectangle?>
<?import javafx.scene.image.ImageView?> <?import javafx.scene.image.ImageView?>
<?import javafx.scene.text.Text?> <?import javafx.scene.text.Text?>
<?import javafx.scene.text.Font?>
<BorderPane xmlns="http://javafx.com/javafx" <BorderPane xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml" xmlns:fx="http://javafx.com/fxml"
fx:controller="uk.ac.aber.cs22120.group20.javafx.DictionaryController" fx:controller="uk.ac.aber.cs22120.group20.javafx.DictionaryController"
fx:id="container"
stylesheets="" stylesheets=""
minWidth="450" minWidth="450"
minHeight="550" minHeight="550"
@ -31,56 +24,56 @@
<left> <left>
<StackPane fx:id="outerBar"> <StackPane fx:id="outerBar">
<Rectangle fx:id="sideBar" fill="dimgray" height="${outerBar.height}" width="50"></Rectangle> <Rectangle fx:id="sideBar" fill="dimgray" height="${outerBar.height}" width="50"/>
<VBox spacing="300"> <VBox spacing="300">
<VBox alignment="TOP_CENTER" maxHeight="${outerBar.height}"> <VBox alignment="TOP_CENTER" maxHeight="${outerBar.height}">
<StackPane onMouseClicked="#dictionaryIconClick"> <StackPane onMouseClicked="#dictionaryIconClick">
<Rectangle fill="white" height="60" width="${sideBar.width}"></Rectangle> <Rectangle fill="white" height="60" width="${sideBar.width}"/>
<HBox alignment="CENTER_RIGHT"> <HBox alignment="CENTER_RIGHT">
<Text fx:id="dictionaryText" fill="white"> <Text fx:id="dictionaryText" fill="white">
<font> <font>
<Font name="System Bold" size="25"></Font> <Font name="System Bold" size="25"/>
</font> </font>
</Text> </Text>
<ImageView fx:id="dictionaryIcon"></ImageView> <ImageView fx:id="dictionaryIcon"/>
</HBox> </HBox>
</StackPane> </StackPane>
<StackPane onMouseClicked="#practiceListIconClick"> <StackPane onMouseClicked="#practiceListIconClick">
<Rectangle fill="dimgray" height="60" width="${sideBar.width}"></Rectangle> <Rectangle fill="dimgray" height="60" width="${sideBar.width}"/>
<HBox alignment="CENTER_RIGHT"> <HBox alignment="CENTER_RIGHT">
<Text fx:id="practiceListTest" fill="white"> <Text fx:id="practiceListTest" fill="white">
<font> <font>
<Font name="System Bold" size="25"></Font> <Font name="System Bold" size="25"/>
</font> </font>
</Text> </Text>
<ImageView fx:id="practiceListIcon"></ImageView> <ImageView fx:id="practiceListIcon"/>
</HBox> </HBox>
</StackPane> </StackPane>
<StackPane onMouseClicked="#flashcardIconClick"> <StackPane onMouseClicked="#flashcardIconClick">
<Rectangle fill="dimgray" height="60" width="${sideBar.width}"></Rectangle> <Rectangle fill="dimgray" height="60" width="${sideBar.width}"/>
<HBox alignment="CENTER_RIGHT"> <HBox alignment="CENTER_RIGHT">
<Text fx:id="flashcardsText" fill="white"> <Text fx:id="flashcardsText" fill="white">
<font> <font>
<Font name="System Bold" size="25"></Font> <Font name="System Bold" size="25"/>
</font> </font>
</Text> </Text>
<ImageView fx:id="flashcardIcon"></ImageView> <ImageView fx:id="flashcardIcon"/>
</HBox> </HBox>
</StackPane> </StackPane>
<StackPane onMouseClicked="#studyIconClick"> <StackPane onMouseClicked="#studyIconClick">
<Rectangle fill="dimgray" height="60" width="${sideBar.width}"></Rectangle> <Rectangle fill="dimgray" height="60" width="${sideBar.width}"/>
<HBox alignment="CENTER_RIGHT"> <HBox alignment="CENTER_RIGHT">
<Text fx:id="studyText" fill="white"> <Text fx:id="studyText" fill="white">
<font> <font>
<Font name="System Bold" size="25"></Font> <Font name="System Bold" size="25"/>
</font> </font>
</Text> </Text>
<ImageView fx:id="studyIcon"></ImageView> <ImageView fx:id="studyIcon"/>
</HBox> </HBox>
</StackPane> </StackPane>
@ -89,15 +82,15 @@
<StackPane alignment="BOTTOM_CENTER" onMouseClicked="#addWordIconClick"> <StackPane alignment="BOTTOM_CENTER" onMouseClicked="#addWordIconClick">
<Rectangle fill="dimgray" height="60" width="${sideBar.width}"></Rectangle> <Rectangle fill="dimgray" height="60" width="${sideBar.width}"/>
<HBox alignment="CENTER_RIGHT"> <HBox alignment="CENTER_RIGHT">
<Text fx:id="addDefinitionText" fill="white"> <Text fx:id="addDefinitionText" fill="white">
<font> <font>
<Font name="System Bold" size="25"></Font> <Font name="System Bold" size="25"/>
</font> </font>
</Text> </Text>
<ImageView fx:id="addDefinitionIcon"></ImageView> <ImageView fx:id="addDefinitionIcon"/>
</HBox> </HBox>
</StackPane> </StackPane>
@ -109,18 +102,18 @@
<top> <top>
<StackPane fx:id="topBar"> <StackPane fx:id="topBar">
<Rectangle fx:id="parentRectangle" fill="dimgray" width="${topBar.width}" height="50"></Rectangle> <Rectangle fx:id="parentRectangle" fill="dimgray" width="${topBar.width}" height="50"/>
<HBox alignment="CENTER_LEFT" prefWidth="${topBar.width}" spacing="7"> <HBox alignment="CENTER_LEFT" prefWidth="${topBar.width}" spacing="7">
<StackPane onMouseClicked="#expandMenuClick"> <StackPane onMouseClicked="#expandMenuClick">
<Rectangle fill="dimgray" width="55" height="50"></Rectangle> <Rectangle fill="dimgray" width="55" height="50"/>
<ImageView fx:id="expandMenuIcon"></ImageView> <ImageView fx:id="expandMenuIcon"/>
</StackPane> </StackPane>
<ImageView fx:id="currentPageIcon"></ImageView> <ImageView fx:id="currentPageIcon"/>
<Text fx:id="currentPageText" fill="white"> <Text fx:id="currentPageText" fill="white">
<font> <font>
<Font name="System Bold" size="25"></Font> <Font name="System Bold" size="25"/>
</font> </font>
</Text> </Text>
</HBox> </HBox>
@ -130,51 +123,46 @@
<center> <center>
<VBox alignment="CENTER" prefHeight="512.0" prefWidth="432.0" spacing="20.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1"> <VBox alignment="CENTER" prefHeight="512.0" prefWidth="432.0" spacing="20.0">
<children>
<HBox alignment="CENTER_LEFT" prefHeight="11.0" prefWidth="392.0" VBox.vgrow="NEVER"> <HBox alignment="CENTER_LEFT" prefHeight="11.0" prefWidth="392.0" VBox.vgrow="NEVER">
<children>
<Label minWidth="-Infinity" text="Search:"> <Label minWidth="-Infinity" text="Search:">
<font> <font>
<Font name="System Bold" size="13.0" /> <Font name="System Bold" size="13.0" />
</font></Label> </font></Label>
<TextField fx:id="searchBox" prefHeight="26.0" prefWidth="519.0" HBox.hgrow="ALWAYS" /> <TextField fx:id="searchBox" prefHeight="26.0" prefWidth="519.0" HBox.hgrow="ALWAYS" />
</children>
</HBox> </HBox>
<HBox alignment="BOTTOM_CENTER" fillHeight="false" prefHeight="14.0" prefWidth="392.0" VBox.vgrow="NEVER"> <HBox alignment="BOTTOM_CENTER" fillHeight="false" prefHeight="14.0" prefWidth="392.0" VBox.vgrow="NEVER">
<children>
<HBox alignment="BOTTOM_CENTER" prefHeight="100.0" prefWidth="200.0" HBox.hgrow="ALWAYS"> <HBox alignment="BOTTOM_CENTER" prefHeight="100.0" prefWidth="200.0" HBox.hgrow="ALWAYS">
<children>
<Label minWidth="-Infinity" text="English"> <Label minWidth="-Infinity" text="English">
<font> <font>
<Font name="System Bold" size="13.0" /> <Font name="System Bold" size="13.0" />
</font></Label> </font></Label>
</children>
</HBox> </HBox>
<HBox alignment="BOTTOM_CENTER" prefHeight="100.0" prefWidth="200.0"> <HBox alignment="BOTTOM_CENTER" prefHeight="100.0" prefWidth="200.0">
<children>
<ImageView fx:id="alphaSort" fitHeight="20.0" fitWidth="20.0" onMouseClicked="#switchAlphaSort" pickOnBounds="true" preserveRatio="true"> <ImageView fx:id="alphaSort" fitHeight="20.0" fitWidth="20.0" onMouseClicked="#switchAlphaSort" pickOnBounds="true" preserveRatio="true">
<HBox.margin> <HBox.margin>
<Insets right="5.0" /> <Insets right="5.0" />
</HBox.margin> </HBox.margin>
</ImageView> </ImageView>
<ImageView fx:id="langSort" fitHeight="20.0" fitWidth="20.0" onMouseClicked="#switchLangSort" pickOnBounds="true" preserveRatio="true"> <ImageView fx:id="langSort" fitHeight="20.0" fitWidth="20.0" onMouseClicked="#switchLangSort" pickOnBounds="true" preserveRatio="true">
<HBox.margin> <HBox.margin>
<Insets left="5.0" /> <Insets left="5.0" />
</HBox.margin> </HBox.margin>
</ImageView> </ImageView>
</children>
</HBox> </HBox>
<HBox alignment="BOTTOM_CENTER" prefHeight="100.0" prefWidth="200.0" HBox.hgrow="ALWAYS"> <HBox alignment="BOTTOM_CENTER" prefHeight="100.0" prefWidth="200.0" HBox.hgrow="ALWAYS">
<children>
<Label minWidth="-Infinity" text="Welsh"> <Label minWidth="-Infinity" text="Welsh">
<font> <font>
<Font name="System Bold" size="13.0" /> <Font name="System Bold" size="13.0" />
</font></Label> </font></Label>
</children>
</HBox> </HBox>
</children>
</HBox> </HBox>
<TableView fx:id="table" VBox.vgrow="ALWAYS"> <TableView fx:id="table" VBox.vgrow="ALWAYS">
<columns> <columns>
@ -185,7 +173,7 @@
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" /> <TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
</columnResizePolicy> </columnResizePolicy>
</TableView> </TableView>
</children>
<padding> <padding>
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" /> <Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
</padding> </padding>

View file

@ -6,11 +6,10 @@
<?import javafx.scene.shape.Rectangle?> <?import javafx.scene.shape.Rectangle?>
<?import javafx.scene.image.ImageView?> <?import javafx.scene.image.ImageView?>
<?import javafx.scene.control.Button?>
<BorderPane xmlns="http://javafx.com/javafx" <BorderPane xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml" xmlns:fx="http://javafx.com/fxml"
fx:controller="uk.ac.aber.cs22120.group20.javafx.FlashcardController" fx:controller="uk.ac.aber.cs22120.group20.javafx.FlashcardController"
fx:id="container"
minWidth="450" minWidth="450"
minHeight="550" minHeight="550"
@ -20,56 +19,56 @@
<left> <left>
<StackPane fx:id="outerBar"> <StackPane fx:id="outerBar">
<Rectangle fx:id="sideBar" fill="dimgray" height="${outerBar.height}" width="50"></Rectangle> <Rectangle fx:id="sideBar" fill="dimgray" height="${outerBar.height}" width="50"/>
<VBox spacing="300"> <VBox spacing="300">
<VBox alignment="TOP_CENTER" maxHeight="${outerBar.height}"> <VBox alignment="TOP_CENTER" maxHeight="${outerBar.height}">
<StackPane onMouseClicked="#dictionaryIconClick"> <StackPane onMouseClicked="#dictionaryIconClick">
<Rectangle fill="dimgray" height="60" width="${sideBar.width}"></Rectangle> <Rectangle fill="dimgray" height="60" width="${sideBar.width}"/>
<HBox alignment="CENTER_RIGHT"> <HBox alignment="CENTER_RIGHT">
<Text fx:id="dictionaryText" fill="white"> <Text fx:id="dictionaryText" fill="white">
<font> <font>
<Font name="System Bold" size="25"></Font> <Font name="System Bold" size="25"/>
</font> </font>
</Text> </Text>
<ImageView fx:id="dictionaryIcon"></ImageView> <ImageView fx:id="dictionaryIcon"/>
</HBox> </HBox>
</StackPane> </StackPane>
<StackPane onMouseClicked="#practiceListIconClick"> <StackPane onMouseClicked="#practiceListIconClick">
<Rectangle fill="dimgray" height="60" width="${sideBar.width}"></Rectangle> <Rectangle fill="dimgray" height="60" width="${sideBar.width}"/>
<HBox alignment="CENTER_RIGHT"> <HBox alignment="CENTER_RIGHT">
<Text fx:id="practiceListTest" fill="white"> <Text fx:id="practiceListTest" fill="white">
<font> <font>
<Font name="System Bold" size="25"></Font> <Font name="System Bold" size="25"/>
</font> </font>
</Text> </Text>
<ImageView fx:id="practiceListIcon"></ImageView> <ImageView fx:id="practiceListIcon"/>
</HBox> </HBox>
</StackPane> </StackPane>
<StackPane onMouseClicked="#flashcardIconClick"> <StackPane onMouseClicked="#flashcardIconClick">
<Rectangle fill="white" height="60" width="${sideBar.width}"></Rectangle> <Rectangle fill="white" height="60" width="${sideBar.width}"/>
<HBox alignment="CENTER_RIGHT"> <HBox alignment="CENTER_RIGHT">
<Text fx:id="flashcardsText" fill="white"> <Text fx:id="flashcardsText" fill="white">
<font> <font>
<Font name="System Bold" size="25"></Font> <Font name="System Bold" size="25"/>
</font> </font>
</Text> </Text>
<ImageView fx:id="flashcardIcon"></ImageView> <ImageView fx:id="flashcardIcon"/>
</HBox> </HBox>
</StackPane> </StackPane>
<StackPane onMouseClicked="#studyIconClick"> <StackPane onMouseClicked="#studyIconClick">
<Rectangle fill="dimgray" height="60" width="${sideBar.width}"></Rectangle> <Rectangle fill="dimgray" height="60" width="${sideBar.width}"/>
<HBox alignment="CENTER_RIGHT"> <HBox alignment="CENTER_RIGHT">
<Text fx:id="studyText" fill="white"> <Text fx:id="studyText" fill="white">
<font> <font>
<Font name="System Bold" size="25"></Font> <Font name="System Bold" size="25"/>
</font> </font>
</Text> </Text>
<ImageView fx:id="studyIcon"></ImageView> <ImageView fx:id="studyIcon"/>
</HBox> </HBox>
</StackPane> </StackPane>
@ -78,15 +77,15 @@
<StackPane alignment="BOTTOM_CENTER" onMouseClicked="#addWordIconClick"> <StackPane alignment="BOTTOM_CENTER" onMouseClicked="#addWordIconClick">
<Rectangle fill="dimgray" height="60" width="${sideBar.width}"></Rectangle> <Rectangle fill="dimgray" height="60" width="${sideBar.width}"/>
<HBox alignment="CENTER_RIGHT"> <HBox alignment="CENTER_RIGHT">
<Text fx:id="addDefinitionText" fill="white"> <Text fx:id="addDefinitionText" fill="white">
<font> <font>
<Font name="System Bold" size="25"></Font> <Font name="System Bold" size="25"/>
</font> </font>
</Text> </Text>
<ImageView fx:id="addDefinitionIcon"></ImageView> <ImageView fx:id="addDefinitionIcon"/>
</HBox> </HBox>
</StackPane> </StackPane>
@ -98,18 +97,18 @@
<top> <top>
<StackPane fx:id="topBar"> <StackPane fx:id="topBar">
<Rectangle fx:id="parentRectangle" fill="dimgray" width="${topBar.width}" height="50"></Rectangle> <Rectangle fx:id="parentRectangle" fill="dimgray" width="${topBar.width}" height="50"/>
<HBox alignment="CENTER_LEFT" prefWidth="${topBar.width}" spacing="7"> <HBox alignment="CENTER_LEFT" prefWidth="${topBar.width}" spacing="7">
<StackPane onMouseClicked="#expandMenuClick"> <StackPane onMouseClicked="#expandMenuClick">
<Rectangle fill="dimgray" width="55" height="50"></Rectangle> <Rectangle fill="dimgray" width="55" height="50"/>
<ImageView fx:id="expandMenuIcon"></ImageView> <ImageView fx:id="expandMenuIcon"/>
</StackPane> </StackPane>
<ImageView fx:id="currentPageIcon"></ImageView> <ImageView fx:id="currentPageIcon"/>
<Text fx:id="currentPageText" fill="white"> <Text fx:id="currentPageText" fill="white">
<font> <font>
<Font name="System Bold" size="25"></Font> <Font name="System Bold" size="25"/>
</font> </font>
</Text> </Text>
</HBox> </HBox>
@ -123,10 +122,9 @@
<padding> <padding>
<Insets top="25" right="25" bottom="10" left="25"/> <Insets top="25" right="25" bottom="10" left="25"/>
</padding> </padding>
<children>
<StackPane alignment="CENTER" onMouseClicked="#handleFlashcardClick" minWidth="500"> <StackPane onMouseClicked="#handleFlashcardClick" minWidth="500">
<children> <ImageView fx:id="flashcard" fitWidth="450" fitHeight="360"/>
<ImageView fx:id="flashcard" fitWidth="450" fitHeight="360"></ImageView>
<Text textAlignment="CENTER" fx:id="testWord"> <Text textAlignment="CENTER" fx:id="testWord">
<font> <font>
<Font size="55"/> <Font size="55"/>
@ -136,20 +134,16 @@
<VBox alignment="BOTTOM_CENTER"> <VBox alignment="BOTTOM_CENTER">
<Text fx:id="wordType" fill="dimgray"> <Text fx:id="wordType" fill="dimgray">
<font> <font>
<Font size="20"></Font> <Font size="20"/>
</font> </font>
</Text> </Text>
</VBox> </VBox>
</children>
</StackPane> </StackPane>
<HBox spacing="190" alignment="BASELINE_CENTER"> <HBox spacing="190" alignment="BASELINE_CENTER">
<children> <ImageView fx:id="leftArrow" onMouseClicked="#handlePreviousCard"/>
<ImageView fx:id="leftArrow" onMouseClicked="#handlePreviousCard"></ImageView> <Text fx:id="counter"><font> <Font size = "20"/></font></Text>
<Text fx:id="counter"><font> <Font size = "20"></Font></font></Text> <ImageView fx:id="rightArrow" onMouseClicked="#handleNextCard"/>
<ImageView fx:id="rightArrow" onMouseClicked="#handleNextCard"></ImageView>
</children>
</HBox> </HBox>
</children>
</VBox> </VBox>

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?> <?import javafx.scene.control.Label?>
<?import javafx.scene.control.TableColumn?> <?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?> <?import javafx.scene.control.TableView?>
@ -17,7 +16,6 @@
<BorderPane xmlns="http://javafx.com/javafx" <BorderPane xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml" xmlns:fx="http://javafx.com/fxml"
fx:controller="uk.ac.aber.cs22120.group20.javafx.PracticeListController" fx:controller="uk.ac.aber.cs22120.group20.javafx.PracticeListController"
fx:id="container"
minWidth="450" minWidth="450"
minHeight="550" minHeight="550"
> >
@ -26,56 +24,56 @@
<left> <left>
<StackPane fx:id="outerBar"> <StackPane fx:id="outerBar">
<Rectangle fx:id="sideBar" fill="dimgray" height="${outerBar.height}" width="50"></Rectangle> <Rectangle fx:id="sideBar" fill="dimgray" height="${outerBar.height}" width="50"/>
<VBox spacing="300"> <VBox spacing="300">
<VBox alignment="TOP_CENTER" maxHeight="${outerBar.height}"> <VBox alignment="TOP_CENTER" maxHeight="${outerBar.height}">
<StackPane onMouseClicked="#dictionaryIconClick"> <StackPane onMouseClicked="#dictionaryIconClick">
<Rectangle fill="dimgray" height="60" width="${sideBar.width}"></Rectangle> <Rectangle fill="dimgray" height="60" width="${sideBar.width}"/>
<HBox alignment="CENTER_RIGHT"> <HBox alignment="CENTER_RIGHT">
<Text fx:id="dictionaryText" fill="white"> <Text fx:id="dictionaryText" fill="white">
<font> <font>
<Font name="System Bold" size="25"></Font> <Font name="System Bold" size="25"/>
</font> </font>
</Text> </Text>
<ImageView fx:id="dictionaryIcon"></ImageView> <ImageView fx:id="dictionaryIcon"/>
</HBox> </HBox>
</StackPane> </StackPane>
<StackPane onMouseClicked="#practiceListIconClick"> <StackPane onMouseClicked="#practiceListIconClick">
<Rectangle fill="white" height="60" width="${sideBar.width}"></Rectangle> <Rectangle fill="white" height="60" width="${sideBar.width}"/>
<HBox alignment="CENTER_RIGHT"> <HBox alignment="CENTER_RIGHT">
<Text fx:id="practiceListTest" fill="white"> <Text fx:id="practiceListTest" fill="white">
<font> <font>
<Font name="System Bold" size="25"></Font> <Font name="System Bold" size="25"/>
</font> </font>
</Text> </Text>
<ImageView fx:id="practiceListIcon"></ImageView> <ImageView fx:id="practiceListIcon"/>
</HBox> </HBox>
</StackPane> </StackPane>
<StackPane onMouseClicked="#flashcardIconClick"> <StackPane onMouseClicked="#flashcardIconClick">
<Rectangle fill="dimgray" height="60" width="${sideBar.width}"></Rectangle> <Rectangle fill="dimgray" height="60" width="${sideBar.width}"/>
<HBox alignment="CENTER_RIGHT"> <HBox alignment="CENTER_RIGHT">
<Text fx:id="flashcardsText" fill="white"> <Text fx:id="flashcardsText" fill="white">
<font> <font>
<Font name="System Bold" size="25"></Font> <Font name="System Bold" size="25"/>
</font> </font>
</Text> </Text>
<ImageView fx:id="flashcardIcon"></ImageView> <ImageView fx:id="flashcardIcon"/>
</HBox> </HBox>
</StackPane> </StackPane>
<StackPane onMouseClicked="#studyIconClick"> <StackPane onMouseClicked="#studyIconClick">
<Rectangle fill="dimgray" height="60" width="${sideBar.width}"></Rectangle> <Rectangle fill="dimgray" height="60" width="${sideBar.width}"/>
<HBox alignment="CENTER_RIGHT"> <HBox alignment="CENTER_RIGHT">
<Text fx:id="studyText" fill="white"> <Text fx:id="studyText" fill="white">
<font> <font>
<Font name="System Bold" size="25"></Font> <Font name="System Bold" size="25"/>
</font> </font>
</Text> </Text>
<ImageView fx:id="studyIcon"></ImageView> <ImageView fx:id="studyIcon"/>
</HBox> </HBox>
</StackPane> </StackPane>
@ -84,15 +82,15 @@
<StackPane alignment="BOTTOM_CENTER" onMouseClicked="#addWordIconClick"> <StackPane alignment="BOTTOM_CENTER" onMouseClicked="#addWordIconClick">
<Rectangle fill="dimgray" height="60" width="${sideBar.width}"></Rectangle> <Rectangle fill="dimgray" height="60" width="${sideBar.width}"/>
<HBox alignment="CENTER_RIGHT"> <HBox alignment="CENTER_RIGHT">
<Text fx:id="addDefinitionText" fill="white"> <Text fx:id="addDefinitionText" fill="white">
<font> <font>
<Font name="System Bold" size="25"></Font> <Font name="System Bold" size="25"/>
</font> </font>
</Text> </Text>
<ImageView fx:id="addDefinitionIcon"></ImageView> <ImageView fx:id="addDefinitionIcon"/>
</HBox> </HBox>
</StackPane> </StackPane>
@ -105,13 +103,13 @@
<top> <top>
<StackPane fx:id="topBar"> <StackPane fx:id="topBar">
<Rectangle fx:id="parentRectangle" fill="dimgray" width="${topBar.width}" height="50"></Rectangle> <Rectangle fx:id="parentRectangle" fill="dimgray" width="${topBar.width}" height="50"></Rectangle>
<HBox alignment="CENTER_LEFT" prefWidth="${topBar.width}" spacing="7"> <HBox alignment="CENTER_LEFT" prefWidth="${topBar.width}" spacing="7">
<StackPane onMouseClicked="#expandMenuClick"> <StackPane onMouseClicked="#expandMenuClick">
<Rectangle fill="dimgray" width="55" height="50"></Rectangle> <Rectangle fill="dimgray" width="55" height="50"/>
<ImageView fx:id="expandMenuIcon"></ImageView> <ImageView fx:id="expandMenuIcon"/>
</StackPane> </StackPane>
<ImageView fx:id="currentPageIcon"></ImageView> <ImageView fx:id="currentPageIcon"/>
<Text fx:id="currentPageText" fill="white"> <Text fx:id="currentPageText" fill="white">
<font> <font>
@ -124,68 +122,59 @@
</top> </top>
<center> <center>
<VBox alignment="CENTER" prefHeight="512.0" prefWidth="432.0" spacing="20.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1"> <VBox alignment="CENTER" prefHeight="512.0" prefWidth="432.0" spacing="20.0"
<children> xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1">
<HBox alignment="CENTER_LEFT" prefHeight="11.0" prefWidth="392.0" VBox.vgrow="NEVER"> <HBox alignment="CENTER_LEFT" prefHeight="11.0" prefWidth="392.0" VBox.vgrow="NEVER">
<children> <Label minWidth="-Infinity" text="Search:">
<Label minWidth="-Infinity" text="Search:"> <font>
<font> <Font name="System Bold" size="13.0"/>
<Font name="System Bold" size="13.0" /> </font>
</font></Label> </Label>
<TextField fx:id="searchBox" prefHeight="26.0" prefWidth="519.0" HBox.hgrow="ALWAYS" /> <TextField fx:id="searchBox" prefHeight="26.0" prefWidth="519.0" HBox.hgrow="ALWAYS"/>
</children> </HBox>
<HBox alignment="BOTTOM_CENTER" fillHeight="false" prefHeight="14.0" prefWidth="392.0" VBox.vgrow="NEVER">
<HBox alignment="BOTTOM_CENTER" prefHeight="100.0" prefWidth="200.0" HBox.hgrow="ALWAYS">
<Label minWidth="-Infinity" text="English">
<font>
<Font name="System Bold" size="13.0"/>
</font>
</Label>
</HBox> </HBox>
<HBox alignment="BOTTOM_CENTER" fillHeight="false" prefHeight="14.0" prefWidth="392.0" VBox.vgrow="NEVER"> <HBox alignment="BOTTOM_CENTER" prefHeight="100.0" prefWidth="200.0">
<children> <ImageView fx:id="alphaSort" fitHeight="20.0" fitWidth="20.0" onMouseClicked="#switchAlphaSort"
<HBox alignment="BOTTOM_CENTER" prefHeight="100.0" prefWidth="200.0" HBox.hgrow="ALWAYS"> pickOnBounds="true" preserveRatio="true">
<children> <HBox.margin>
<Label minWidth="-Infinity" text="English"> <Insets right="5.0"/>
<font> </HBox.margin>
<Font name="System Bold" size="13.0" /> </ImageView>
</font></Label> <ImageView fx:id="langSort" fitHeight="20.0" fitWidth="20.0" onMouseClicked="#switchLangSort"
</children> pickOnBounds="true" preserveRatio="true">
</HBox> <HBox.margin>
<HBox alignment="BOTTOM_CENTER" prefHeight="100.0" prefWidth="200.0"> <Insets left="5.0"/>
<children> </HBox.margin>
<ImageView fx:id="alphaSort" fitHeight="20.0" fitWidth="20.0" onMouseClicked="#switchAlphaSort" pickOnBounds="true" preserveRatio="true"> </ImageView>
<HBox.margin>
<Insets right="5.0" />
</HBox.margin>
</ImageView>
<ImageView fx:id="langSort" fitHeight="20.0" fitWidth="20.0" onMouseClicked="#switchLangSort" pickOnBounds="true" preserveRatio="true">
<HBox.margin>
<Insets left="5.0" />
</HBox.margin>
</ImageView>
</children>
</HBox>
<HBox alignment="BOTTOM_CENTER" prefHeight="100.0" prefWidth="200.0" HBox.hgrow="ALWAYS">
<children>
<Label minWidth="-Infinity" text="Welsh">
<font>
<Font name="System Bold" size="13.0" />
</font></Label>
</children>
</HBox>
</children>
</HBox> </HBox>
<TableView fx:id="table" VBox.vgrow="ALWAYS"> <HBox alignment="BOTTOM_CENTER" prefHeight="100.0" prefWidth="200.0" HBox.hgrow="ALWAYS">
<columns> <Label minWidth="-Infinity" text="Welsh">
<TableColumn fx:id="english" prefWidth="196.0" text="English" /> <font>
<TableColumn fx:id="welsh" prefWidth="195.0" text="Welsh" /> <Font name="System Bold" size="13.0"/>
</columns> </font>
<columnResizePolicy> </Label>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" /> </HBox>
</columnResizePolicy> </HBox>
</TableView> <TableView fx:id="table" VBox.vgrow="ALWAYS">
</children> <columns>
<TableColumn fx:id="english" prefWidth="196.0" text="English"/>
<TableColumn fx:id="welsh" prefWidth="195.0" text="Welsh"/>
</columns>
<columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY"/>
</columnResizePolicy>
</TableView>
<padding> <padding>
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" /> <Insets bottom="20.0" left="20.0" right="20.0" top="20.0"/>
</padding> </padding>
</VBox> </VBox>
</center> </center>
</BorderPane> </BorderPane>