aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/gui/population/ChromosomePane.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jcgp/gui/population/ChromosomePane.java')
-rw-r--r--src/jcgp/gui/population/ChromosomePane.java15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/jcgp/gui/population/ChromosomePane.java b/src/jcgp/gui/population/ChromosomePane.java
index 6a5b33f..bf9db72 100644
--- a/src/jcgp/gui/population/ChromosomePane.java
+++ b/src/jcgp/gui/population/ChromosomePane.java
@@ -80,15 +80,9 @@ public class ChromosomePane extends ScrollPane {
Line lines[] = new Line[GUI.resources.arity()];
for (int l = 0; l < lines.length; l++) {
lines[l] = new Line();
-
-// angle = ((((double) (l + 1)) / ((double) (lines.length + 1))) * Constants.THETA) - (Constants.THETA / 2);
-// xPos = (-Math.cos(angle) * Constants.NODE_RADIUS) + (((c + 1) * (2 * Constants.NODE_RADIUS + Constants.SPACING)) + Constants.NODE_RADIUS) + Constants.SOCKET_RADIUS;
-// yPos = (Math.sin(angle) * Constants.NODE_RADIUS) + ((r * (2 * Constants.NODE_RADIUS + Constants.SPACING)) + Constants.NODE_RADIUS);
-// lines[l].setStartX(xPos);
-// lines[l].setStartX(yPos);
-
+
Position.connect(lines[l], (GUIGene) ((Gene) node.getConnection(l)).getGUIObject());
-
+
lines[l].setMouseTransparent(true);
lines[l].setVisible(false);
connectionLines.add(lines[l]);
@@ -109,10 +103,13 @@ public class ChromosomePane extends ScrollPane {
*/
guiOutputs = new GUIOutput[GUI.resources.outputs()];
for (int i = 0; i < guiOutputs.length; i++) {
- Line line = new Line();
// get the backend output
Output output = chromosome.getOutput(i);
// make the GUI elements
+ Line line = new Line();
+ Position.connect(line, (GUIGene) ((Gene) output.getSource()).getGUIObject());
+ line.setVisible(false);
+ line.setMouseTransparent(true);
guiOutputs[i] = new GUIOutput(output, line);
// assign the GUI object to the associated backend element
output.setGUIObject(guiOutputs[i]);