package jcgp.gui.population; import javafx.beans.property.SimpleObjectProperty; import javafx.scene.Group; import javafx.scene.shape.Circle; import javafx.scene.text.Text; import jcgp.population.Gene; enum GUIGeneState { NEUTRAL, HOVER, INDIRECT_HOVER, ACTIVE_HOVER, SOURCE, TARGET, NO_CHANGE_TARGET, FORBIDDEN_TARGET } public abstract class GUIGene extends Group { public static final double NODE_RADIUS = 30; public static final double SPACING = 15; public static final double THETA = Math.PI / 1.4; public static final double SOCKET_RADIUS = Math.sqrt(NODE_RADIUS) / 1.8; public static final double NODE_TEXT = 0; protected Text text; protected Circle mainCircle; protected SimpleObjectProperty stateProperty = new SimpleObjectProperty(GUIGeneState.NEUTRAL); protected ChromosomePane parent; public SimpleObjectProperty stateProperty() { return stateProperty; } public void setState(GUIGeneState newState) { stateProperty.set(newState); } public void showText(boolean value) { text.setVisible(value); } public abstract Gene getGene(); public abstract void setConnections(GUIGeneState newState); public abstract void resetState(); }