diff options
Diffstat (limited to 'src/jcgp/gui/population/GUIOutput.java')
-rw-r--r-- | src/jcgp/gui/population/GUIOutput.java | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/src/jcgp/gui/population/GUIOutput.java b/src/jcgp/gui/population/GUIOutput.java index 16d95f0..9c5dfa5 100644 --- a/src/jcgp/gui/population/GUIOutput.java +++ b/src/jcgp/gui/population/GUIOutput.java @@ -13,12 +13,12 @@ import javafx.scene.shape.Line; import javafx.scene.text.Font; import javafx.scene.text.Text; import javafx.scene.text.TextAlignment; -import jcgp.GUI; +import jcgp.backend.population.Connection; +import jcgp.backend.population.Input; +import jcgp.backend.population.Node; +import jcgp.backend.population.Output; import jcgp.gui.ChromosomePane; -import jcgp.population.Connection; -import jcgp.population.Input; -import jcgp.population.Node; -import jcgp.population.Output; +import jcgp.gui.GUI; public class GUIOutput extends GUIGene { @@ -281,7 +281,7 @@ public class GUIOutput extends GUIGene { } @Override - public void setLocked(boolean value) { + void setLocked(boolean value) { locked += value ? 1 : -1; setConnections(value ? GUIGeneState.HOVER : GUIGeneState.ACTIVE_HOVER); @@ -314,5 +314,20 @@ public class GUIOutput extends GUIGene { sourceLine.setEndX(gene.getLayoutX() + NODE_RADIUS); sourceLine.setEndY(gene.getLayoutY()); } + + public void unlock() { + if (isLocked()) { + setLocked(false); + stateProperty.set(GUIGeneState.NEUTRAL); + setConnections(GUIGeneState.NEUTRAL); + } + } + + public void lock() { + if (!isLocked()) { + stateProperty.set(GUIGeneState.HOVER); + setLocked(true); + } + } } |