Match the meaning concept

This commit is contained in:
maj83 2020-04-14 11:32:01 +01:00
parent d0e259e637
commit e9c420402a
15 changed files with 759 additions and 0 deletions

View file

4
dev/20200407/maj83/.idea/encodings.xml generated Normal file
View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>

View file

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="lib">
<CLASSES>
<root url="file://$PROJECT_DIR$/../javafx-sdk-14/lib" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/../javafx-sdk-14/lib" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/../javafx-sdk-14/lib" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/../javafx-sdk-14/lib" recursive="false" type="SOURCES" />
</library>
</component>

6
dev/20200407/maj83/.idea/misc.xml generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

8
dev/20200407/maj83/.idea/modules.xml generated Normal file
View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Match the meaning.iml" filepath="$PROJECT_DIR$/Match the meaning.iml" />
</modules>
</component>
</project>

397
dev/20200407/maj83/.idea/workspace.xml generated Normal file
View file

@ -0,0 +1,397 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="fbb2a4a0-47c2-4eac-8067-df2e585c83b3" name="Default Changelist" comment="" />
<ignored path="$PROJECT_DIR$/out/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Main.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="391">
<caret line="23" lean-forward="true" selection-start-line="23" selection-end-line="23" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/MyController.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-34">
<caret line="19" lean-forward="true" selection-start-line="19" selection-end-line="19" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/DictionaryEntry.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="442">
<caret line="26" column="30" selection-start-line="26" selection-start-column="22" selection-end-line="26" selection-end-column="30" />
<folding>
<element signature="e#234#235#0" expanded="true" />
<element signature="e#278#279#0" expanded="true" />
<element signature="e#513#514#0" expanded="true" />
<element signature="e#551#552#0" expanded="true" />
<element signature="e#601#602#0" expanded="true" />
<element signature="e#647#648#0" expanded="true" />
<element signature="e#683#684#0" expanded="true" />
<element signature="e#719#720#0" expanded="true" />
<element signature="e#765#766#0" expanded="true" />
<element signature="e#807#808#0" expanded="true" />
<element signature="e#847#848#0" expanded="true" />
<element signature="e#886#887#0" expanded="true" />
<element signature="e#938#939#0" expanded="true" />
<element signature="e#986#987#0" expanded="true" />
<element signature="e#1030#1031#0" expanded="true" />
<element signature="e#1073#1074#0" expanded="true" />
<element signature="e#1135#1136#0" expanded="true" />
<element signature="e#1191#1192#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/MatchTheMeaning.fxml">
<provider editor-type-id="JavaFX-Scene-Builder" />
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="374">
<caret line="22" column="17" lean-forward="true" selection-start-line="22" selection-start-column="17" selection-end-line="22" selection-end-column="17" />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Class" />
</list>
</option>
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/src/DictionaryEntry.java" />
<option value="$PROJECT_DIR$/src/MyController.java" />
<option value="$PROJECT_DIR$/src/Main.java" />
<option value="$PROJECT_DIR$/src/MatchTheMeaning.fxml" />
</list>
</option>
</component>
<component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="-9" />
<option name="y" value="-9" />
<option name="width" value="1938" />
<option name="height" value="1058" />
</component>
<component name="ProjectView">
<navigator proportions="" version="1">
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="Match the meaning" type="b2602c69:ProjectViewProjectNode" />
<item name="Match the meaning" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="Match the meaning" type="b2602c69:ProjectViewProjectNode" />
<item name="Match the meaning" type="462c0819:PsiDirectoryNode" />
<item name="out" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="Match the meaning" type="b2602c69:ProjectViewProjectNode" />
<item name="Match the meaning" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="PackagesPane" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" />
<property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1586814345266" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../javafx-sdk-14/lib" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
<property name="project.structure.last.edited" value="Libraries" />
<property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="RunManager">
<configuration name="Main" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="Main" />
<module name="Match the meaning" />
<option name="VM_PARAMETERS" value="--module-path C:\Users\Marcin\Desktop\javafx-sdk-14\lib --add-modules javafx.controls,javafx.fxml" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<recent_temporary>
<list>
<item itemvalue="Application.Main" />
</list>
</recent_temporary>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="fbb2a4a0-47c2-4eac-8067-df2e585c83b3" name="Default Changelist" comment="" />
<created>1586778885037</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1586778885037</updated>
<workItem from="1586778888266" duration="4356000" />
<workItem from="1586790476649" duration="5671000" />
<workItem from="1586796522495" duration="9386000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="19413000" />
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
<layout>
<window_info content_ui="combo" id="Project" order="0" weight="0.08848614" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Image Layers" order="2" />
<window_info id="Designer" order="3" />
<window_info id="UI Designer" order="4" />
<window_info id="Capture Tool" order="5" />
<window_info id="Favorites" order="6" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="bottom" id="Run" order="2" weight="0.21776815" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.24485373" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
<window_info anchor="bottom" id="Version Control" order="8" />
<window_info anchor="bottom" id="Database Changes" order="9" />
<window_info anchor="bottom" id="Terminal" order="10" />
<window_info anchor="bottom" id="Event Log" order="11" side_tool="true" />
<window_info anchor="bottom" id="Messages" order="12" weight="0.32936078" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
<window_info anchor="right" id="Palette" order="3" />
<window_info anchor="right" id="Database" order="4" />
<window_info anchor="right" id="Theme Preview" order="5" />
<window_info anchor="right" id="Maven" order="6" />
<window_info anchor="right" id="Capture Analysis" order="7" />
<window_info anchor="right" id="Palette&#9;" order="8" />
</layout>
<layout-to-restore>
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.08848614" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Image Layers" order="2" />
<window_info id="Designer" order="3" />
<window_info id="UI Designer" order="4" />
<window_info id="Capture Tool" order="5" />
<window_info id="Favorites" order="6" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.21776815" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
<window_info anchor="bottom" id="Version Control" order="8" />
<window_info anchor="bottom" id="Database Changes" order="9" />
<window_info anchor="bottom" id="Terminal" order="10" />
<window_info anchor="bottom" id="Event Log" order="11" side_tool="true" />
<window_info anchor="bottom" id="Messages" order="12" weight="0.32936078" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
<window_info anchor="right" id="Palette" order="3" />
<window_info anchor="right" id="Database" order="4" />
<window_info anchor="right" id="Theme Preview" order="5" />
<window_info anchor="right" id="Maven" order="6" />
<window_info anchor="right" id="Capture Analysis" order="7" />
<window_info anchor="right" id="Palette&#9;" order="8" />
</layout-to-restore>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/out/production/Match the meaning/DictionaryEntry.class">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="306">
<caret line="19" lean-forward="true" selection-start-line="19" selection-end-line="19" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/MyController.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-34">
<caret line="19" lean-forward="true" selection-start-line="19" selection-end-line="19" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Main.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="391">
<caret line="23" lean-forward="true" selection-start-line="23" selection-end-line="23" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/DictionaryEntry.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="442">
<caret line="26" column="30" selection-start-line="26" selection-start-column="22" selection-end-line="26" selection-end-column="30" />
<folding>
<element signature="e#234#235#0" expanded="true" />
<element signature="e#278#279#0" expanded="true" />
<element signature="e#513#514#0" expanded="true" />
<element signature="e#551#552#0" expanded="true" />
<element signature="e#601#602#0" expanded="true" />
<element signature="e#647#648#0" expanded="true" />
<element signature="e#683#684#0" expanded="true" />
<element signature="e#719#720#0" expanded="true" />
<element signature="e#765#766#0" expanded="true" />
<element signature="e#807#808#0" expanded="true" />
<element signature="e#847#848#0" expanded="true" />
<element signature="e#886#887#0" expanded="true" />
<element signature="e#938#939#0" expanded="true" />
<element signature="e#986#987#0" expanded="true" />
<element signature="e#1030#1031#0" expanded="true" />
<element signature="e#1073#1074#0" expanded="true" />
<element signature="e#1135#1136#0" expanded="true" />
<element signature="e#1191#1192#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/MatchTheMeaning.fxml">
<provider editor-type-id="JavaFX-Scene-Builder" />
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="374">
<caret line="22" column="17" lean-forward="true" selection-start-line="22" selection-start-column="17" selection-end-line="22" selection-end-column="17" />
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>
<state key="ArtifactsStructureConfigurable.UI">
<settings>
<artifact-editor />
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="FacetStructureConfigurable.UI">
<settings>
<last-edited>No facets are configured</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="GlobalLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="JdkListConfigurable.UI">
<settings>
<last-edited>11</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ModuleStructureConfigurable.UI">
<settings>
<last-edited>Match the meaning</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
<option value="0.6" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectLibrariesConfigurable.UI">
<settings>
<last-edited>lib</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="lib" level="project" />
</component>
</module>

View file

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.collections.*?>
<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.Pane?>
<?import java.lang.String?>
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="MyController">
<children>
<Button fx:id="ConfirmButton" layoutX="271.0" layoutY="321.0" mnemonicParsing="false" text="Confirm"/>
<Label layoutX="248.0" layoutY="356.0" text="Match the meaning" />
<ComboBox fx:id="word1" layoutX="448.0" layoutY="118.0" prefHeight="25.0" prefWidth="58.0">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="#1"/>
<String fx:value="#2"/>
<String fx:value="#3"/>
<String fx:value="#4"/>
</FXCollections>
</items>
</ComboBox>
<ComboBox fx:id="word2" layoutX="448.0" layoutY="153.0" prefHeight="25.0" prefWidth="58.0" promptText="#1" >
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="#1"/>
<String fx:value="#2"/>
<String fx:value="#3"/>
<String fx:value="#4"/>
</FXCollections>
</items>
</ComboBox>
<ComboBox fx:id="word3" layoutX="448.0" layoutY="188.0" prefHeight="25.0" prefWidth="58.0" promptText="#1" >
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="#1"/>
<String fx:value="#2"/>
<String fx:value="#3"/>
<String fx:value="#4"/>
</FXCollections>
</items>
</ComboBox>
<ComboBox fx:id="word4" layoutX="448.0" layoutY="223.0" prefHeight="25.0" prefWidth="58.0" promptText="#1" >
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="#1"/>
<String fx:value="#2"/>
<String fx:value="#3"/>
<String fx:value="#4"/>
</FXCollections>
</items>
</ComboBox>
<Label fx:id="WelshWord1" layoutX="343.0" layoutY="122.0" text="Welsh word#3" />
<Label fx:id="WelshWord2" layoutX="343.0" layoutY="192.0" text="Welsh word#2" />
<Label fx:id="WelshWord3" layoutX="343.0" layoutY="157.0" text="Welsh word#1" />
<Label fx:id="WelshWord4" layoutX="343.0" layoutY="227.0" text="Welsh word#4" />
<Label fx:id="EngWord1" layoutX="115.0" layoutY="122.0" text="English Word #1" />
<Label fx:id="EngWord2" layoutX="115.0" layoutY="157.0" text="English Word #2" />
<Label fx:id="EngWord3" layoutX="115.0" layoutY="192.0" text="English Word #3" />
<Label fx:id="EngWord4" layoutX="115.0" layoutY="227.0" text="English Word #4" />
<Label layoutX="105.0" layoutY="122.0" text="1." />
<Label layoutX="105.0" layoutY="157.0" text="2." />
<Label layoutX="105.0" layoutY="192.0" text="3." />
<Label layoutX="105.0" layoutY="227.0" text="4." />
</children>
</Pane>

View file

@ -0,0 +1,64 @@
public class DictionaryEntry {
private String english;
private String welsh;
private String wordType;
private boolean practiceWord;
public DictionaryEntry(){
practiceWord = false;
}
public DictionaryEntry(String english, String welsh, String wordType ){
this.english = english;
this.welsh = welsh;
this.wordType = wordType;
}
public String getEnglish() {
return english;
}
public void setEnglish(String english) {
this.english = english;
}
public String getWelsh() {
return welsh;
}
public void setWelsh(String welsh) {
this.welsh = welsh;
}
public String getWordType() {
return wordType;
}
public void setWordType(String wordType) {
this.wordType = wordType;
}
public boolean isPracticeWord() {
return practiceWord;
}
public void setPracticeWord(boolean practiceWord) {
this.practiceWord = practiceWord;
}
@Override
public String toString() {
return "english='" + english + "'\t" +
"welsh='" + welsh + "'\t" +
"wordType='" + wordType + "'" +
"practiceWord = " + practiceWord;
}
}

View file

@ -0,0 +1,23 @@
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;
public class Main extends Application{
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception{
Pane mainPane = FXMLLoader.load(Main.class.getResource("MatchTheMeaning.fxml"));
primaryStage.setScene(new Scene(mainPane));
primaryStage.show();
}
}

View file

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.collections.*?>
<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.Pane?>
<?import java.lang.String?>
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="MyController">
<children>
<Button fx:id="ConfirmButton" layoutX="271.0" layoutY="321.0" mnemonicParsing="false" text="Confirm"/>
<Label layoutX="248.0" layoutY="356.0" text="Match the meaning" />
<ComboBox fx:id="word1" layoutX="448.0" layoutY="118.0" prefHeight="25.0" prefWidth="58.0">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="#1"/>
<String fx:value="#2"/>
<String fx:value="#3"/>
<String fx:value="#4"/>
</FXCollections>
</items>
</ComboBox>
<ComboBox fx:id="word2" layoutX="448.0" layoutY="153.0" prefHeight="25.0" prefWidth="58.0" promptText="#1" >
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="#1"/>
<String fx:value="#2"/>
<String fx:value="#3"/>
<String fx:value="#4"/>
</FXCollections>
</items>
</ComboBox>
<ComboBox fx:id="word3" layoutX="448.0" layoutY="188.0" prefHeight="25.0" prefWidth="58.0" promptText="#1" >
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="#1"/>
<String fx:value="#2"/>
<String fx:value="#3"/>
<String fx:value="#4"/>
</FXCollections>
</items>
</ComboBox>
<ComboBox fx:id="word4" layoutX="448.0" layoutY="223.0" prefHeight="25.0" prefWidth="58.0" promptText="#1" >
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="#1"/>
<String fx:value="#2"/>
<String fx:value="#3"/>
<String fx:value="#4"/>
</FXCollections>
</items>
</ComboBox>
<Label fx:id="WelshWord1" layoutX="343.0" layoutY="122.0" text="Welsh word#3" />
<Label fx:id="WelshWord2" layoutX="343.0" layoutY="192.0" text="Welsh word#2" />
<Label fx:id="WelshWord3" layoutX="343.0" layoutY="157.0" text="Welsh word#1" />
<Label fx:id="WelshWord4" layoutX="343.0" layoutY="227.0" text="Welsh word#4" />
<Label fx:id="EngWord1" layoutX="115.0" layoutY="122.0" text="English Word #1" />
<Label fx:id="EngWord2" layoutX="115.0" layoutY="157.0" text="English Word #2" />
<Label fx:id="EngWord3" layoutX="115.0" layoutY="192.0" text="English Word #3" />
<Label fx:id="EngWord4" layoutX="115.0" layoutY="227.0" text="English Word #4" />
<Label layoutX="105.0" layoutY="122.0" text="1." />
<Label layoutX="105.0" layoutY="157.0" text="2." />
<Label layoutX="105.0" layoutY="192.0" text="3." />
<Label layoutX="105.0" layoutY="227.0" text="4." />
</children>
</Pane>

View file

@ -0,0 +1,98 @@
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.ComboBox;
import javafx.scene.control.Label;
import java.net.URL;
import java.util.*;
public class MyController implements Initializable {
private Random rand = new Random();
public LinkedList<DictionaryEntry> setOfQuestions=new LinkedList<>();
private ArrayList<Integer> temp1 = new ArrayList<>(Arrays.asList(0,1,2,3));
@FXML
private ComboBox<?> word1;
@FXML
private ComboBox<?> word2;
@FXML
private ComboBox<?> word3;
@FXML
private ComboBox<?> word4;
@FXML
private Label EngWord1;
@FXML
private Label EngWord2;
@FXML
private Label EngWord3;
@FXML
private Label EngWord4;
@FXML
private Label WelshWord1;
@FXML
private Label WelshWord2;
@FXML
private Label WelshWord3;
@FXML
private Label WelshWord4;
private void TestLabel(LinkedList<DictionaryEntry> questions, ArrayList<Integer> randOrder){
EngWord1.setText(questions.get(0).getEnglish());
EngWord2.setText(questions.get(1).getEnglish());
EngWord3.setText(questions.get(2).getEnglish());
EngWord4.setText(questions.get(3).getEnglish());
Collections.shuffle(randOrder);
WelshWord1.setText(questions.get(randOrder.get(0)).getWelsh());
WelshWord2.setText(questions.get(randOrder.get(1)).getWelsh());
WelshWord3.setText(questions.get(randOrder.get(2)).getWelsh());
WelshWord4.setText(questions.get(randOrder.get(3)).getWelsh());
}
private LinkedList<DictionaryEntry> getQuestions(LinkedList<DictionaryEntry> dictionary){
do{
int rand_q=rand.nextInt(dictionary.size()-1);
DictionaryEntry pickedQuestion = dictionary.get(rand_q);
if(setOfQuestions.size()>1){
for(int i=0;i<setOfQuestions.size();i++){
if(setOfQuestions.get(i).equals(pickedQuestion)){
break;
}else {
setOfQuestions.add(pickedQuestion);
}
}
}else{
setOfQuestions.add(pickedQuestion);
}
}while(setOfQuestions.size()<5);
return setOfQuestions;
}
private void fill(){
setOfQuestions.add(new DictionaryEntry("abbey", "abaty", "nm"));
setOfQuestions.add(new DictionaryEntry("believe", "credu", "verb"));
setOfQuestions.add(new DictionaryEntry("concert", "cyngerdd", "nm"));
setOfQuestions.add(new DictionaryEntry("disease", "clefyd", "nm"));
}
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
this.fill();
TestLabel(setOfQuestions,temp1);
}
}