aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/gui/population
diff options
context:
space:
mode:
Diffstat (limited to 'src/jcgp/gui/population')
-rw-r--r--src/jcgp/gui/population/GUIInput.java22
-rw-r--r--src/jcgp/gui/population/GUINode.java2
-rw-r--r--src/jcgp/gui/population/GUIOutput.java2
3 files changed, 8 insertions, 18 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());
}
diff --git a/src/jcgp/gui/population/GUINode.java b/src/jcgp/gui/population/GUINode.java
index 2b953c0..f50edd3 100644
--- a/src/jcgp/gui/population/GUINode.java
+++ b/src/jcgp/gui/population/GUINode.java
@@ -454,7 +454,7 @@ public class GUINode extends GUIGene {
public void updateText() {
if (parent.isEvaluating()) {
- text.setText(node.getFunction().getName() + "\nValue: " + value.toString());
+ text.setText(node.getFunction().getName() + "\n" + value.toString());
} else {
text.setText(node.getFunction().getName());
}
diff --git a/src/jcgp/gui/population/GUIOutput.java b/src/jcgp/gui/population/GUIOutput.java
index 89c12b3..79159b9 100644
--- a/src/jcgp/gui/population/GUIOutput.java
+++ b/src/jcgp/gui/population/GUIOutput.java
@@ -321,7 +321,7 @@ public class GUIOutput extends GUIGene {
@Override
public void updateText() {
if (parent.isEvaluating()) {
- text.setText("O: " + output.getIndex() + "\nValue: " + value.toString());
+ text.setText("O: " + output.getIndex() + "\n" + value.toString());
} else {
text.setText("O: " + output.getIndex());
}