public class AmmoEditController
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private javafx.scene.control.ComboBox<java.lang.String> |
caliber
Drop-down selection for caliber.
|
private javafx.stage.Stage |
dialogStage
Dialog stage.
|
private MainApp |
mainApp
Main application.
|
private boolean |
okClicked
Boolean for confirmation button.
|
| Constructor and Description |
|---|
AmmoEditController() |
| Modifier and Type | Method and Description |
|---|---|
private void |
handleCancel()
Closes stage if operation is cancelled.
|
void |
handleOk()
Called when confirmation button is clicked
Sets main application´s ammy type whether to 120mm or to 81mm, depending on user input.
|
private void |
initialize()
Initializes the controller class.
|
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 populates ComboBox with two options:81mm and 120mm.
|
private MainApp mainApp
private javafx.stage.Stage dialogStage
private javafx.scene.control.ComboBox<java.lang.String> caliber
private boolean okClicked
private void initialize()
public void setMainApp(MainApp mainApp)
mainApp - MainApp objectpublic void setDialogStage(javafx.stage.Stage dialogStage)
dialogStage - Dialog Stagepublic boolean isOkClicked()
private void handleCancel()
public void handleOk()
okClicked to true and closes dialog.public void onEnter(javafx.event.ActionEvent ae)
handleOk() method if Enter key is pressed.ae - ActionEvent.