diff options
author | Eduardo Pedroni <ep625@york.ac.uk> | 2014-04-21 00:09:55 +0100 |
---|---|---|
committer | Eduardo Pedroni <ep625@york.ac.uk> | 2014-04-21 00:09:55 +0100 |
commit | efe490fec1c7a94f004b496c7c97c82083fe44ec (patch) | |
tree | ffe7a8bb411a9208c3220247247081eb90ac4fc0 /src/jcgp/gui/population | |
parent | 88314e71f908efcfc38da3b800319c171a6ccceb (diff) |
Tooltips are looking strange, checking on a different machine
Diffstat (limited to 'src/jcgp/gui/population')
-rw-r--r-- | src/jcgp/gui/population/GUIInput.java | 22 | ||||
-rw-r--r-- | src/jcgp/gui/population/GUINode.java | 2 | ||||
-rw-r--r-- | src/jcgp/gui/population/GUIOutput.java | 2 |
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()); } |