Class SettingsController
java.lang.Object
controller.SettingsController
Controller class for handling the settings UI interactions.
Provides methods to update simulation parameters through sliders.
-
Field Summary
FieldsModifier and TypeFieldDescriptionjavafx.scene.control.TextFieldjavafx.scene.control.TextField -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddecrementValue(javafx.scene.control.TextField field) Decrements the value of the given text field by one.intReturns the maximum group size.intReturns the table amount.intvoidhandleButtonAction(javafx.event.ActionEvent event) Handles the button actions for incrementing and decrementing values.voidincrementValue(javafx.scene.control.TextField field) Increments the value of the given text field by one.voidInitializes the settings view.voidSets the engine for the controller.voidsetGroupSize(int size) Sets the maximum group size to the given value.voidsetMainController(ControllerForFxml mainController) Sets the main controller for the controller.voidsetTableAmount(int tableAmount) voidsetTableSize(int tableSize) voidupdateSettingsView(javafx.scene.control.TextField field) Updates the settings view based on the given text field.voidupdateSliderValue(javafx.scene.control.Slider slider, String type) Updates the simulation parameters based on the slider value.voidUpdates the text fields with the current settings values.
-
Field Details
-
tableAmountField
public javafx.scene.control.TextField tableAmountField -
tableSizeField
public javafx.scene.control.TextField tableSizeField
-
-
Constructor Details
-
SettingsController
public SettingsController()
-
-
Method Details
-
initialize
public void initialize()Initializes the settings view. -
setEngine
Sets the engine for the controller.- Parameters:
engine- the engine to set
-
setMainController
Sets the main controller for the controller.- Parameters:
mainController- the main controller to set
-
updateSliderValue
Updates the simulation parameters based on the slider value.- Parameters:
slider- the slider to updatetype- the type of parameter to update
-
getMaxGroupSize
public int getMaxGroupSize()Returns the maximum group size.- Returns:
- the maximum group size
-
getTableAmount
public int getTableAmount()Returns the table amount.- Returns:
- the table amount
-
getTableSize
public int getTableSize() -
setTableAmount
public void setTableAmount(int tableAmount) -
setTableSize
public void setTableSize(int tableSize) -
decrementValue
public void decrementValue(javafx.scene.control.TextField field) Decrements the value of the given text field by one.- Parameters:
field- the text field to decrement
-
incrementValue
public void incrementValue(javafx.scene.control.TextField field) Increments the value of the given text field by one.- Parameters:
field- the text field to increment
-
handleButtonAction
public void handleButtonAction(javafx.event.ActionEvent event) Handles the button actions for incrementing and decrementing values.- Parameters:
event- the action event
-
updateSettingsView
public void updateSettingsView(javafx.scene.control.TextField field) Updates the settings view based on the given text field.- Parameters:
field- the text field to update
-
setGroupSize
public void setGroupSize(int size) Sets the maximum group size to the given value.- Parameters:
size- the maximum group size
-
updateTextFields
public void updateTextFields()Updates the text fields with the current settings values.
-