aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/gui/population/GUIOutput.java
diff options
context:
space:
mode:
authorEduardo Pedroni <e.pedroni91@gmail.com>2015-03-09 16:40:17 -0300
committerEduardo Pedroni <e.pedroni91@gmail.com>2015-03-09 16:40:17 -0300
commitff5248437491f1829c0168b271e85cb358516577 (patch)
tree1c41e92769d8186b2d6e05efe8bdb6d205b01156 /src/jcgp/gui/population/GUIOutput.java
parentdb2bc6e935ff1632d78ea8a03606b396944ef21e (diff)
Moved GUI to its own repositoryHEADmaster
Diffstat (limited to 'src/jcgp/gui/population/GUIOutput.java')
-rw-r--r--src/jcgp/gui/population/GUIOutput.java79
1 files changed, 0 insertions, 79 deletions
diff --git a/src/jcgp/gui/population/GUIOutput.java b/src/jcgp/gui/population/GUIOutput.java
deleted file mode 100644
index f023d00..0000000
--- a/src/jcgp/gui/population/GUIOutput.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package jcgp.gui.population;
-
-import javafx.scene.paint.Paint;
-import javafx.scene.shape.Circle;
-import javafx.scene.shape.Line;
-import jcgp.backend.population.Gene;
-import jcgp.backend.population.Output;
-import jcgp.gui.constants.Constants;
-import jcgp.gui.constants.Position;
-import jcgp.gui.handlers.OutputHandlers;
-
-/**
- * The GUI counterpart of {@link jcgp.backend.population.Output}. This is a
- * subclass of {@code GUIGene} which represents a chromosome output.
- *
- * @author Eduardo Pedroni
- */
-public class GUIOutput extends GUIGene implements GUIMutable {
-
- private Output output;
- private Line line;
-
- /**
- * Instantiate {@code GUIOutput} given an {@code Output} and the line needed
- * to show its connection.
- *
- * @param output the associated backend output.
- * @param line the line used to display connection.
- */
- public GUIOutput(final Output output, Line line) {
- super();
- // store references, associate with backend object
- this.output = output;
- this.line = line;
- output.setGUIObject(this);
-
- // create input socket
- Circle socket = new Circle(-Constants.NODE_RADIUS, 0, Constants.SOCKET_RADIUS, Constants.SOCKET_PAINT);
- socket.setStroke(Paint.valueOf("black"));
- socket.setId(String.valueOf(0));
- Position.connect(line, (GUIGene) ((Gene) output.getSource()).getGUIObject());
- getChildren().add(socket);
-
- // relocate output, add handlers
- Position.place(this);
- OutputHandlers.addHandlers(this);
- }
-
- /**
- * @return the {@code Output} instance associated with this object.
- */
- public Output getOutput() {
- return output;
- }
-
- /**
- * Associates this instance with a new output.
- *
- * @param output the new output.
- */
- void setOutput(Output output) {
- this.output = output;
- }
-
- @Override
- public Line[] getLines() {
- return new Line[] {line};
- }
-
- @Override
- protected void setLinesVisible(boolean value) {
- line.setVisible(value);
- }
-
- @Override
- public GUIConnection[] getConnections() {
- return new GUIConnection[] {(GUIConnection) output.getGUIObject()};
- }
-}