aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/gui/population/GUIOutput.java
diff options
context:
space:
mode:
authorEduardo Pedroni <e.pedroni91@gmail.com>2014-11-15 23:30:20 +0000
committerEduardo Pedroni <e.pedroni91@gmail.com>2014-11-15 23:30:20 +0000
commitd0718fe4762f6a50ec851085cb5d0e6d39ccc1b0 (patch)
tree44ba8a6db7beb8000141ba33a8b5a7bbc2f90580 /src/jcgp/gui/population/GUIOutput.java
parent12ebe6f6375e7db31ba1bb2eba5e3b28b51c7a19 (diff)
Added GUIConnection and GUIMutable, started reintroducing lines but positioning is not working correctly.
Diffstat (limited to 'src/jcgp/gui/population/GUIOutput.java')
-rw-r--r--src/jcgp/gui/population/GUIOutput.java23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/jcgp/gui/population/GUIOutput.java b/src/jcgp/gui/population/GUIOutput.java
index ccc96c3..8ae9485 100644
--- a/src/jcgp/gui/population/GUIOutput.java
+++ b/src/jcgp/gui/population/GUIOutput.java
@@ -1,17 +1,29 @@
package jcgp.gui.population;
+import javafx.scene.control.Label;
import javafx.scene.paint.Paint;
+import javafx.scene.shape.Circle;
import jcgp.backend.population.Output;
import jcgp.gui.constants.Constants;
-public class GUIOutput extends GUIGene {
+public abstract class GUIOutput extends GUIGene implements GUIMutable {
private Output output;
public GUIOutput(final Output output) {
super();
-
this.output = output;
+
+ Circle socket = new Circle(-Constants.NODE_RADIUS, 0, Constants.SOCKET_RADIUS, Paint.valueOf("white"));
+ socket.setId(String.valueOf(0));
+ socket.setStroke(Paint.valueOf("black"));
+
+ Label connectionLabel = new Label("S");
+ connectionLabel.setStyle("-fx-background-color:rgb(255, 255, 255); -fx-border-color:rgba(0, 0, 0, 0.5);");
+ connectionLabel.relocate(socket.getCenterX() + 5, socket.getCenterY() - 10);
+ connectionLabel.setVisible(false);
+
+ getChildren().addAll(socket, connectionLabel);
}
void setOutput(Output output2) {
@@ -21,11 +33,14 @@ public class GUIOutput extends GUIGene {
@Override
public void mouseEnter() {
- mainCircle.setFill(Paint.valueOf(Constants.SOFT_HIGHLIGHT_COLOUR));
+ setState(GUIGeneState.HOVER);
+ getGUIConnection(output.getSource()).activeHover(true);
}
@Override
public void mouseExit() {
- mainCircle.setFill(Paint.valueOf(Constants.NEUTRAL_COLOUR));
+ setState(GUIGeneState.NEUTRAL);
+ getGUIConnection(output.getSource()).activeHover(false);
}
+
}