diff options
author | Eduardo Pedroni <ep625@york.ac.uk> | 2014-05-21 06:40:56 +0100 |
---|---|---|
committer | Eduardo Pedroni <ep625@york.ac.uk> | 2014-05-21 06:40:56 +0100 |
commit | 5f2c1d32f71cc9f640c10ca7348ef9056916854d (patch) | |
tree | 2152a7d862106e2871e19114cfe8e778586ab473 /src/jcgp/gui/population/GUIInput.java | |
parent | bf1243df0ba0255269173c9bd74e292f5f5934d0 (diff) |
More minor refactorings, added some comments
Diffstat (limited to 'src/jcgp/gui/population/GUIInput.java')
-rw-r--r-- | src/jcgp/gui/population/GUIInput.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/jcgp/gui/population/GUIInput.java b/src/jcgp/gui/population/GUIInput.java index fd66ab4..a48be51 100644 --- a/src/jcgp/gui/population/GUIInput.java +++ b/src/jcgp/gui/population/GUIInput.java @@ -43,7 +43,7 @@ public class GUIInput extends GUIGene { if (input == source) { setState(GUIGeneState.NO_CHANGE_TARGET); } else { - setState(GUIGeneState.TARGET); + setState(GUIGeneState.VALID_TARGET); } } }); @@ -59,7 +59,7 @@ public class GUIInput extends GUIGene { setState(GUIGeneState.INDIRECT_HOVER); } else { setState(GUIGeneState.NEUTRAL); - ((GUIGene) event.getGestureSource()).setConnections(GUIGeneState.INDIRECT_HOVER); + ((GUIGene) event.getGestureSource()).setConnectionStates(GUIGeneState.INDIRECT_HOVER); } } } @@ -73,10 +73,10 @@ public class GUIInput extends GUIGene { // set states to reflect the new situation if (source.isLocked()) { source.setState(GUIGeneState.HOVER); - source.setConnections(GUIGeneState.HOVER); + source.setConnectionStates(GUIGeneState.HOVER); } else { source.setState(GUIGeneState.NEUTRAL); - source.setConnections(GUIGeneState.NEUTRAL); + source.setConnectionStates(GUIGeneState.NEUTRAL); } // the user released the drag gesture on this node, react appropriately @@ -111,7 +111,7 @@ public class GUIInput extends GUIGene { // cursor has left this node without dragging, or it is dragging and this is the source if (getState() == GUIGeneState.HOVER) { setState(GUIGeneState.NEUTRAL); - setConnections(GUIGeneState.NEUTRAL); + setConnectionStates(GUIGeneState.NEUTRAL); } } }); @@ -129,7 +129,7 @@ public class GUIInput extends GUIGene { mainCircle.setFill(Paint.valueOf(GUI.SOFT_HIGHLIGHT_COLOUR)); } break; - case FORBIDDEN_TARGET: + case INVALID_TARGET: mainCircle.setFill(Paint.valueOf(GUI.BAD_SELECTION_COLOUR)); break; case LOCKED_HOVER: @@ -155,7 +155,7 @@ public class GUIInput extends GUIGene { case SOURCE: mainCircle.setFill(Paint.valueOf(GUI.MEDIUM_HIGHLIGHT_COLOUR)); break; - case TARGET: + case VALID_TARGET: parent.setTarget(true); mainCircle.setFill(Paint.valueOf(GUI.GOOD_SELECTION_COLOUR)); break; @@ -171,7 +171,7 @@ public class GUIInput extends GUIGene { * @param newState the state to set connections to. */ @Override - public void setConnections(GUIGeneState newState) { + public void setConnectionStates(GUIGeneState newState) { // nothing } @@ -181,7 +181,7 @@ public class GUIInput extends GUIGene { } @Override - void setLocked(boolean value) { + protected void setLocked(boolean value) { locked += value ? 1 : -1; setState(locked > 0 ? GUIGeneState.HOVER : GUIGeneState.ACTIVE_HOVER); } |