diff options
Diffstat (limited to 'src/jcgp/gui/population')
-rw-r--r-- | src/jcgp/gui/population/ChromosomePane.java | 15 | ||||
-rw-r--r-- | src/jcgp/gui/population/GUIOutput.java | 2 |
2 files changed, 7 insertions, 10 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]); diff --git a/src/jcgp/gui/population/GUIOutput.java b/src/jcgp/gui/population/GUIOutput.java index ebc23d0..a07fd90 100644 --- a/src/jcgp/gui/population/GUIOutput.java +++ b/src/jcgp/gui/population/GUIOutput.java @@ -43,6 +43,6 @@ public class GUIOutput extends GUIGene implements GUIMutable { @Override protected void setLinesVisible(boolean value) { - line.setVisible(true); + line.setVisible(value); } } |