From 3e720a9e16d69b310dfbe7574235dc0eace6ccec Mon Sep 17 00:00:00 2001 From: Jessica Syder Date: Thu, 31 Aug 2017 22:47:57 +1200 Subject: [PATCH] Modified key bindings can be saved to use in a race. - new key bindings replace old new bindings on save - javadoc save method and small updates #story[1197] --- .../visualiser/Controllers/KeyBindingsController.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/racevisionGame/src/main/java/visualiser/Controllers/KeyBindingsController.java b/racevisionGame/src/main/java/visualiser/Controllers/KeyBindingsController.java index aa8cf66f..5822179c 100644 --- a/racevisionGame/src/main/java/visualiser/Controllers/KeyBindingsController.java +++ b/racevisionGame/src/main/java/visualiser/Controllers/KeyBindingsController.java @@ -91,7 +91,7 @@ public class KeyBindingsController { } /** - * Makes a copy of the keyfactory that does not modify the original. + * Makes a copy of the {@link KeyFactory} that does not modify the original. * @return new keyfactory to be modified */ public KeyFactory copyExistingFactory(){ @@ -109,7 +109,8 @@ public class KeyBindingsController { /** * Creates a listener for the base anchorpane for key presses. - * It updates the current key bindings if required. + * It updates the current key bindings of the {@link KeyFactory} if + * required. */ public void setKeyListener(){ anchor.addEventFilter(KeyEvent.KEY_PRESSED, event -> { @@ -150,8 +151,11 @@ public class KeyBindingsController { System.out.println("reset clicked"); } + /** + * Replace existing {@link KeyFactory} with the modified key bindings. + */ public void save(){ - System.out.println("save clicked"); + keyFactory = newKeyFactory; } }