public class TempEditController
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private javafx.stage.Stage |
dialogStage
Dialog stage.
|
private MainApp |
mainApp
Main application.
|
private boolean |
okClicked
Boolean for confirmation button.
|
private javafx.scene.control.TextField |
tempField
Temperature field.
|
| Constructor and Description |
|---|
TempEditController() |
| Modifier and Type | Method and Description |
|---|---|
private void |
handleCancel()
Called when the user clicks cancel.
|
private void |
handleOk()
Called when confirmation button is clicked
Sets main application´s temperature to new value.
|
private void |
initialize()
Initializes the controller class.
|
private boolean |
isInputValid()
Validates the user input in the text fields.
|
boolean |
isNumeric(java.lang.String s)
Returns true if given string is numeric and false if it´s not.
|
boolean |
isOkClicked()
Returns true if confirmation button is pressed, false if not.
|
void |
onEnter(javafx.event.ActionEvent ae)
Calls
handleOk() method if Enter key is pressed. |
void |
setDialogStage(javafx.stage.Stage dialogStage)
Sets the stage of this dialog.
|
void |
setMainApp(MainApp mainApp)
Set´s class main application and sets temperature field to previous value.
|
private javafx.scene.control.TextField tempField
private javafx.stage.Stage dialogStage
private boolean okClicked
private MainApp mainApp
private void initialize()
public void setDialogStage(javafx.stage.Stage dialogStage)
dialogStage - Dialog Stagepublic boolean isOkClicked()
public void setMainApp(MainApp mainApp)
mainApp - MainApp objectprivate void handleOk()
okClicked to true and closes dialog.public void onEnter(javafx.event.ActionEvent ae)
handleOk() method if Enter key is pressed.ae - ActionEvent.private void handleCancel()
public boolean isNumeric(java.lang.String s)
s - String to be checked.private boolean isInputValid()