public class CorrectionController
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private javafx.stage.Stage |
dialogStage
Dialog stage.
|
private java.util.ArrayList<javafx.scene.control.TextField> |
fields
Array containing all correction fields.
|
private javafx.scene.control.TextField |
FOdirection
Direction of correction.
|
private javafx.scene.control.TextField |
Kpar
Correction of mortar mine to right.
|
private javafx.scene.control.TextField |
Ksur
Correction of mortar mine in increase.
|
private javafx.scene.control.TextField |
Kvah
Correction of mortar mine in decrease.
|
private javafx.scene.control.TextField |
Kvas
Correction of mortar mine to left.
|
private MainApp |
mainApp
Main Application.
|
private boolean |
okClicked
Boolean for confirmation button.
|
private javafx.scene.control.TextField |
Slan
Correction of smoke mortar mine in fall.
|
private javafx.scene.control.TextField |
Spar
Correction of smoke mortar mine to right.
|
private javafx.scene.control.TextField |
Ssur
Correction of smoke mortar mine in increase.
|
private javafx.scene.control.TextField |
Stos
Correction of smoke mortar mine in lift.
|
private javafx.scene.control.TextField |
Svah
Correction of smoke mortar mine in decrease.
|
private javafx.scene.control.TextField |
Svas
Correction of smoke mortar mine to left.
|
private Target |
target
Target.
|
private javafx.scene.control.TextField |
Vlan
Correction of lightning mortar mine in fall.
|
private javafx.scene.control.TextField |
Vpar
Correction of lightning mortar mine to right.
|
private javafx.scene.control.TextField |
Vsur
Correction of lightning mortar mine in increase.
|
private javafx.scene.control.TextField |
Vtos
Correction of lightning mortar mine in lift.
|
private javafx.scene.control.TextField |
Vvah
Correction of lightning mortar mine in decrease.
|
private javafx.scene.control.TextField |
Vvas
Correction of lightning mortar mine to left.
|
| Constructor and Description |
|---|
CorrectionController() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCorrection()
Makes correction to the target
Creates new array for each type of ammunition containing it´s corrections.
|
java.lang.String |
cordCheck(java.lang.String dir)
Checks coordinate or direction format and returns it in correct format.
|
private void |
handleCancel()
Closes stage if operation is cancelled.
|
void |
handleOk()
Called when confirmation button is clicked
Calls
isInputValid() method to check whether the
fields are valid. |
private void |
initialize()
Initializes the controller class.
|
private boolean |
isInputValid()
Checks if fields are valid.
|
boolean |
isNumeric(java.lang.String s)
Returns true if giveen 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 .
|
void |
setTarget(Target Target)
Sets target.
|
private javafx.scene.control.TextField FOdirection
private javafx.scene.control.TextField Kvas
private javafx.scene.control.TextField Kpar
private javafx.scene.control.TextField Ksur
private javafx.scene.control.TextField Kvah
private javafx.scene.control.TextField Svas
private javafx.scene.control.TextField Spar
private javafx.scene.control.TextField Ssur
private javafx.scene.control.TextField Svah
private javafx.scene.control.TextField Stos
private javafx.scene.control.TextField Slan
private javafx.scene.control.TextField Vvas
private javafx.scene.control.TextField Vpar
private javafx.scene.control.TextField Vsur
private javafx.scene.control.TextField Vvah
private javafx.scene.control.TextField Vtos
private javafx.scene.control.TextField Vlan
private MainApp mainApp
private Target target
private javafx.stage.Stage dialogStage
private boolean okClicked
private java.util.ArrayList<javafx.scene.control.TextField> fields
private void initialize()
public void setMainApp(MainApp mainApp)
fields array.mainApp - MainApppublic void setDialogStage(javafx.stage.Stage dialogStage)
dialogStage - Given dialog Stagepublic boolean isOkClicked()
private void handleCancel()
public void handleOk()
isInputValid() method to check whether the
fields are valid.
Calls addCorrection() method to make the correction to target.
Sets okClicked to true and closes dialog.public void setTarget(Target Target)
Target - Given target.public void onEnter(javafx.event.ActionEvent ae)
handleOk() method if Enter key is pressed.ae - ActionEvent.public boolean isNumeric(java.lang.String s)
s - String to be checked.public java.lang.String cordCheck(java.lang.String dir)
dir - Given coordinate or direction as string.public void addCorrection()
private boolean isInputValid()