aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/gui/handlers/InputHandlers.java
diff options
context:
space:
mode:
authorEduardo Pedroni <e.pedroni91@gmail.com>2015-03-09 16:40:17 -0300
committerEduardo Pedroni <e.pedroni91@gmail.com>2015-03-09 16:40:17 -0300
commitff5248437491f1829c0168b271e85cb358516577 (patch)
tree1c41e92769d8186b2d6e05efe8bdb6d205b01156 /src/jcgp/gui/handlers/InputHandlers.java
parentdb2bc6e935ff1632d78ea8a03606b396944ef21e (diff)
Moved GUI to its own repositoryHEADmaster
Diffstat (limited to 'src/jcgp/gui/handlers/InputHandlers.java')
-rw-r--r--src/jcgp/gui/handlers/InputHandlers.java56
1 files changed, 0 insertions, 56 deletions
diff --git a/src/jcgp/gui/handlers/InputHandlers.java b/src/jcgp/gui/handlers/InputHandlers.java
deleted file mode 100644
index cc677eb..0000000
--- a/src/jcgp/gui/handlers/InputHandlers.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package jcgp.gui.handlers;
-
-import javafx.event.EventHandler;
-import javafx.scene.input.MouseEvent;
-import jcgp.gui.population.GUIGene.GUIGeneState;
-import jcgp.gui.population.GUIInput;
-
-/**
- * Holds the handlers that define the behaviour of {@code GUIInput}.
- * <br><br>
- * The handlers are instantiated here statically and added to {@code GUIInput}
- * instances using {@code InputHandlers.addHandlers(...)}. This guarantees that
- * all inputs behave the same way without instantiating a new set of handlers for
- * each input instance.
- *
- * @author Eduardo Pedroni
- *
- */
-public final class InputHandlers {
-
- /**
- * Private constructor to prevent instantiation.
- */
- private InputHandlers() {}
-
- /**
- * Inputs don't do much; set state to hover when mouse enters.
- */
- private static EventHandler<MouseEvent> mouseEnteredHandler = new EventHandler<MouseEvent>() {
- @Override
- public void handle(MouseEvent event) {
- ((GUIInput) event.getSource()).setState(GUIGeneState.HOVER);
- }
- };
-
- /**
- * Inputs don't do much; set state to neutral when mouse exits.
- */
- private static EventHandler<MouseEvent> mouseExitedHandler = new EventHandler<MouseEvent>() {
- @Override
- public void handle(MouseEvent event) {
- ((GUIInput) event.getSource()).setState(GUIGeneState.NEUTRAL);
- }
- };
-
- /**
- * Adds all handlers to the specified input.
- *
- * @param input the {@code GUIInput} to which the handlers will be added.
- */
- public static void addHandlers(GUIInput input) {
- input.addEventHandler(MouseEvent.MOUSE_ENTERED, mouseEnteredHandler);
- input.addEventHandler(MouseEvent.MOUSE_EXITED, mouseExitedHandler);
- }
-
-}