Module de.seggebaeing.sqlanalyzer
Class EvaluationController
java.lang.Object
de.seggebaeing.sqlanalyzer.presentation.uielements.window.TitledInitializableWindow
de.seggebaeing.sqlanalyzer.presentation.uielements.window.WorkerWindow
de.seggebaeing.sqlanalyzer.presentation.controller.general.EvaluationController
- All Implemented Interfaces:
javafx.fxml.Initializable
Controller for the evaluation workflow. Extends
WorkerWindow
to run an EvaluationThread
, choose a StatementComparator
(e.g. LLM-based), show progress (and optional rate-limit countdown), and export
results to CSV on save.- Since:
- 1.0
- Author:
- Felix Seggebäing
-
Field Summary
Fields inherited from class de.seggebaeing.sqlanalyzer.presentation.uielements.window.WorkerWindow
workerProperty
Fields inherited from class de.seggebaeing.sqlanalyzer.presentation.uielements.window.TitledInitializableWindow
root
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Thread
Constructs the evaluation worker thread and wires UI progress bindings.getTitle()
Returns the fixed title for the evaluation window.void
initialize
(URL location, ResourceBundle resources) Callssuper.initialize(...)
and enables the evaluation help link.protected void
Exports evaluation results to CSV using the configured output path.protected void
Opens the Evaluation Settings window for configuring the run.protected boolean
Validates preconditions for starting evaluation: Comparator is set: forLLM
type, requires a model andtemp >= 0
; for non-LLM, any non-null type is acceptable. There is at least one generated query selected. Thread pool size and max repetitions are positive.Methods inherited from class de.seggebaeing.sqlanalyzer.presentation.uielements.window.WorkerWindow
addDualProgressBar, signalDone
Methods inherited from class de.seggebaeing.sqlanalyzer.presentation.uielements.window.TitledInitializableWindow
closeWindow, enableHelp, getRoot, getStage
-
Constructor Details
-
EvaluationController
public EvaluationController()
-
-
Method Details
-
initialize
Callssuper.initialize(...)
and enables the evaluation help link.- Specified by:
initialize
in interfacejavafx.fxml.Initializable
- Overrides:
initialize
in classWorkerWindow
- Parameters:
location
- FXML location (may benull
)resources
- localization bundle (may benull
)- Implementation Note:
- Invoke on the JavaFX Application Thread.
-
getTitle
Returns the fixed title for the evaluation window.- Specified by:
getTitle
in classTitledInitializableWindow
- Returns:
- the string
"Evaluation"
-
saveBtnClick
protected void saveBtnClick()Exports evaluation results to CSV using the configured output path. Retrieves the result map from the activeEvaluationThread
; shows a toast if no output path is set, attempts export, logs and toasts on failure, and toasts success on completion.- Specified by:
saveBtnClick
in classWorkerWindow
- Implementation Note:
- Assumes
workerProperty.get()
is a completedEvaluationThread
. Runs on the JavaFX Application Thread.
-
createWorkerThread
Constructs the evaluation worker thread and wires UI progress bindings. Sets up started/finished counters, an optional rate-limit countdown target, adds aDualProgressBar
, selects theStatementComparator
(e.g. LLM-based), and returns a configuredEvaluationThread
that reports progress viaPlatform.runLater(Runnable)
callbacks.- Specified by:
createWorkerThread
in classWorkerWindow
- Returns:
- a not-yet-started
Thread
ready to evaluate the selected queries - Implementation Note:
- Progress is computed against the size of
settings.getGeneratedQueriesSelection()
.
-
showSettingsPopup
protected void showSettingsPopup()Opens the Evaluation Settings window for configuring the run.- Specified by:
showSettingsPopup
in classWorkerWindow
-
startValid
protected boolean startValid()Validates preconditions for starting evaluation:- Comparator is set: for
LLM
type, requires a model andtemp >= 0
; for non-LLM, any non-null type is acceptable. - There is at least one generated query selected.
- Thread pool size and max repetitions are positive.
- Specified by:
startValid
in classWorkerWindow
- Returns:
true
if all checks pass;false
otherwise
- Comparator is set: for
-