aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/gui/population/GUIInput.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jcgp/gui/population/GUIInput.java')
-rw-r--r--src/jcgp/gui/population/GUIInput.java22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/jcgp/gui/population/GUIInput.java b/src/jcgp/gui/population/GUIInput.java
index 6a783db..065c125 100644
--- a/src/jcgp/gui/population/GUIInput.java
+++ b/src/jcgp/gui/population/GUIInput.java
@@ -7,7 +7,6 @@ import javafx.scene.paint.Paint;
import javafx.scene.shape.Circle;
import jcgp.backend.population.Connection;
import jcgp.backend.population.Input;
-import jcgp.backend.population.Output;
import jcgp.gui.GUI;
public class GUIInput extends GUIGene {
@@ -40,20 +39,12 @@ public class GUIInput extends GUIGene {
// the drag has entered this node, react appropriately
// this happens even if we are the source of the drag
((GUIGene) event.getGestureSource()).setConnectionLine((GUIGene) event.getSource());
-
- if (event.getGestureSource() instanceof GUINode) {
- Connection source = ((GUINode) event.getGestureSource()).getChangingConnection();
- if (input == source) {
- setState(GUIGeneState.NO_CHANGE_TARGET);
- return;
- }
- } else if (event.getGestureSource() instanceof GUIOutput) {
- Output source = ((GUIOutput) event.getGestureSource()).getGene();
- if (((GUIGene) event.getSource()).getGene() == source.getSource()) {
- ((GUIGene) event.getSource()).setState(GUIGeneState.NO_CHANGE_TARGET);
- }
+ Connection source = ((GUIGene) event.getGestureSource()).getChangingConnection();
+ if (input == source) {
+ setState(GUIGeneState.NO_CHANGE_TARGET);
+ } else {
+ setState(GUIGeneState.TARGET);
}
- setState(GUIGeneState.TARGET);
}
});
@@ -170,7 +161,6 @@ public class GUIInput extends GUIGene {
break;
default:
break;
-
}
}
@@ -241,7 +231,7 @@ public class GUIInput extends GUIGene {
@Override
public void updateText() {
if (parent.isEvaluating()) {
- text.setText("I: " + input.getIndex() + "\nValue: " + value.toString());
+ text.setText("I: " + input.getIndex() + "\n" + value.toString());
} else {
text.setText("I: " + input.getIndex());
}