public class GUI
extends javafx.application.Application
PopulationPane
), the control pane (SettingsPane
) and
the console (ConsolePane
). Click on any of the links in
brackets to see more information about each interface component.
Service
which calls nextGeneration()
in a loop
until it is interrupted by the main JavaFX thread.
nextGeneration()
and flush()
method calls on a lock object.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BAD_SELECTION_COLOUR
A string containing the hexadecimal colour used for representing a bad selection.
|
static double |
CONSOLE_MIN_HEIGHT
The minimum width of the console pane, to prevent it
from being resized beyond visibility.
|
static java.lang.String |
GOOD_SELECTION_COLOUR
A string containing the hexadecimal colour used for representing a good selection.
|
static java.lang.String |
HARD_HIGHLIGHT_COLOUR
A string containing the hexadecimal colour used for representing a hard highlight.
|
static java.lang.String |
MEDIUM_HIGHLIGHT_COLOUR
A string containing the hexadecimal colour used for a medium highlight.
|
static java.lang.String |
NEUTRAL_COLOUR
A string containing the hexadecimal colour used for representing neutrality.
|
static java.lang.String |
NEUTRAL_SELECTION_COLOUR
A string containing the hexadecimal colour used for representing a neutral selection.
|
static double |
RESIZE_MARGIN
The width or height of the area that can be clicked on
to drag-resize a pane.
|
static double |
SETTINGS_MIN_WIDTH
The minimum width of the settings pane, to prevent it
from being resized beyond visibility.
|
static java.lang.String |
SOFT_HIGHLIGHT_COLOUR
A string containing the hexadecimal colour used for a soft highlight.
|
Constructor and Description |
---|
GUI()
Makes a new instance of GUI.
|
Modifier and Type | Method and Description |
---|---|
void |
bringFunctionSelector(javafx.scene.input.MouseEvent event,
GUINode node)
Relocate the function selector to the right position
relative to the specified node and set it visible.
|
void |
evaluateTestCase(TestCaseProblem.TestCase<java.lang.Object> testCase)
Starts the evaluation process with the given test case.
|
void |
flushConsole()
Writes all buffered content out to the GUI console.
|
int |
getChromosomeIndex() |
JCGP |
getExperiment() |
javafx.stage.Stage |
getStage() |
void |
hideGeneValues()
Hide all evaluated values.
|
boolean |
isWorking() |
static void |
main(java.lang.String[] args)
Start JCGP with the user interface.
|
void |
reDraw()
Does a complete GUI refresh.
|
void |
reset()
Reset button callback.
|
void |
runPause()
Run/pause method.
|
void |
setEvaluating(boolean value)
Set the system into evaluation mode.
|
void |
start(javafx.stage.Stage primaryStage) |
void |
step()
Perform a single generation using
nextGeneration() . |
void |
updateFunctionSelector()
Refresh the function selector, used when functions are enabled or disabled.
|
public static final java.lang.String NEUTRAL_COLOUR
public static final java.lang.String HARD_HIGHLIGHT_COLOUR
public static final java.lang.String MEDIUM_HIGHLIGHT_COLOUR
public static final java.lang.String SOFT_HIGHLIGHT_COLOUR
public static final java.lang.String GOOD_SELECTION_COLOUR
public static final java.lang.String NEUTRAL_SELECTION_COLOUR
public static final java.lang.String BAD_SELECTION_COLOUR
public static final double RESIZE_MARGIN
public static final double SETTINGS_MIN_WIDTH
public static final double CONSOLE_MIN_HEIGHT
public GUI()
public static void main(java.lang.String[] args)
args
- no arguments are used.public void start(javafx.stage.Stage primaryStage) throws java.lang.Exception
start
in class javafx.application.Application
java.lang.Exception
public void runPause()
public void step()
nextGeneration()
.
public void reset()
reset()
on jcgp.public void reDraw()
public void updateFunctionSelector()
public boolean isWorking()
public void bringFunctionSelector(javafx.scene.input.MouseEvent event, GUINode node)
event
- the mouse event containing cursor coordinates.node
- the node whose function should be changed.public JCGP getExperiment()
JCGP
experiment.public void evaluateTestCase(TestCaseProblem.TestCase<java.lang.Object> testCase)
evaluateTestCase()
on
the population pane.testCase
- the test case to evaluate.public void hideGeneValues()
public void setEvaluating(boolean value)
value
- true if evaluations are happening, false otherwise.public javafx.stage.Stage getStage()
public void flushConsole()
public int getChromosomeIndex()