package jcgp.gui.handlers; import javafx.event.EventHandler; import javafx.scene.input.MouseEvent; import jcgp.gui.population.GUIGene.GUIGeneState; import jcgp.gui.population.GUIInput; public final class InputHandlers { private static EventHandler mouseEnteredHandler = new EventHandler() { @Override public void handle(MouseEvent event) { //((GUIGene) event.getSource()).mouseEnter(); ((GUIInput) event.getSource()).setState(GUIGeneState.HOVER); } }; private static EventHandler mouseExitedHandler = new EventHandler() { @Override public void handle(MouseEvent event) { //((GUIGene) event.getSource()).mouseExit(); ((GUIInput) event.getSource()).setState(GUIGeneState.NEUTRAL); } }; public static void addHandlers(GUIInput input) { input.addEventHandler(MouseEvent.MOUSE_ENTERED, mouseEnteredHandler); input.addEventHandler(MouseEvent.MOUSE_EXITED, mouseExitedHandler); } }