diff options
author | Eduardo Pedroni <e.pedroni91@gmail.com> | 2014-11-15 19:16:25 +0000 |
---|---|---|
committer | Eduardo Pedroni <e.pedroni91@gmail.com> | 2014-11-15 19:16:25 +0000 |
commit | 12ebe6f6375e7db31ba1bb2eba5e3b28b51c7a19 (patch) | |
tree | e4ed8c2617550db031d8cf94cdc52d71ac972cab /src/jcgp/gui/handlers | |
parent | d0aca8c4035a59bdb562650a4a8d6efbcf55f2ca (diff) |
Added GUIHandlers file for extracted handlers, started removing parent class references from genes
Diffstat (limited to 'src/jcgp/gui/handlers')
-rw-r--r-- | src/jcgp/gui/handlers/GUIHandlers.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/jcgp/gui/handlers/GUIHandlers.java b/src/jcgp/gui/handlers/GUIHandlers.java new file mode 100644 index 0000000..d5b48b6 --- /dev/null +++ b/src/jcgp/gui/handlers/GUIHandlers.java @@ -0,0 +1,30 @@ +package jcgp.gui.handlers; + +import javafx.event.EventHandler; +import javafx.scene.input.MouseEvent; +import jcgp.gui.population.GUIGene; + +public class GUIHandlers { + + private static final EventHandler<MouseEvent> mouseEnteredHandler = new EventHandler<MouseEvent>() { + @Override + public void handle(MouseEvent event) { + ((GUIGene) event.getSource()).mouseEnter(); + } + }; + + private static final EventHandler<MouseEvent> mouseExitedHandler = new EventHandler<MouseEvent>() { + @Override + public void handle(MouseEvent event) { + ((GUIGene) event.getSource()).mouseExit(); + } + }; + + + public static void addHandlers(GUIGene gene) { + gene.addEventHandler(MouseEvent.MOUSE_ENTERED, mouseEnteredHandler); + gene.addEventHandler(MouseEvent.MOUSE_EXITED, mouseExitedHandler); + } + + +} |