Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable Reciprocal Button when needed. #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 39 additions & 56 deletions src/seg/java/controllers/DashboardController.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.canvas.Canvas;
import javafx.scene.control.Alert;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.control.*;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.Pane;
Expand All @@ -28,58 +25,33 @@
public class DashboardController {
Airport currentAirport;
Runway currentRunway;
@FXML
private TextField heightTextbox;
@FXML
private Pane topDownPane;
@FXML
private Pane sideOnPane;
@FXML
private Pane topDownPaneCopy;
@FXML
private Pane sideOnPaneCopy;
@FXML
private ChoiceBox runwayDroplist;
@FXML
private Canvas topDownCanvas;
@FXML
private Canvas sideOnCanvas;
@FXML
private Canvas topDownCanvasCopy;
@FXML
private Canvas sideOnCanvasCopy;
@FXML
private TextField xLTextbox;
@FXML
private TextField xRTextbox;
@FXML
private TextField yTextbox;
@FXML
private TextField toraInitialTextbox;
@FXML
private TextField todaInitialTextbox;
@FXML
private TextField asdaInitialTextbox;
@FXML
private TextField ldaInitialTextbox;
@FXML
private TextField thresholdInitialTextbox;
@FXML
private TextField toraNewTextbox;
@FXML
private TextField todaNewTextbox;
@FXML
private TextField asdaNewTextbox;
@FXML
private TextField ldaNewTextbox;
@FXML
private TextArea toraBDTextArea;
@FXML
private TextArea todaBDTextArea;
@FXML
private TextArea asdaBDTextArea;
@FXML
private TextArea ldaBDTextArea;
@FXML private TextField heightTextbox;
@FXML private Pane topDownPane;
@FXML private Pane sideOnPane;
@FXML private Pane topDownPaneCopy;
@FXML private Pane sideOnPaneCopy;
@FXML private ChoiceBox runwayDroplist;
@FXML private Canvas topDownCanvas;
@FXML private Canvas sideOnCanvas;
@FXML private Canvas topDownCanvasCopy;
@FXML private Canvas sideOnCanvasCopy;
@FXML private TextField xLTextbox;
@FXML private TextField xRTextbox;
@FXML private TextField yTextbox;
@FXML private TextField toraInitialTextbox;
@FXML private TextField todaInitialTextbox;
@FXML private TextField asdaInitialTextbox;
@FXML private TextField ldaInitialTextbox;
@FXML private TextField thresholdInitialTextbox;
@FXML private TextField toraNewTextbox;
@FXML private TextField todaNewTextbox;
@FXML private TextField asdaNewTextbox;
@FXML private TextField ldaNewTextbox;
@FXML private TextArea toraBDTextArea;
@FXML private TextArea todaBDTextArea;
@FXML private TextArea asdaBDTextArea;
@FXML private TextArea ldaBDTextArea;
@FXML private Button switchButton;
private CanvasDrawer canvasDrawer;
private RedeclarationComputer redeclarationComputer;
private RedeclarationComputer reciprocalComputer;
Expand Down Expand Up @@ -132,6 +104,9 @@ public void initialize() {
greentickIcon = new Image("/seg/resources/images/greentick.png");
warningIcon = new Image("/seg/resources/images/alert-triangle-yellow.png");
switchIcon = new Image("/seg/resources/images/switch.png");

// Disable Switch Button
switchButton.disableProperty().setValue(true);
}

/*==================================================================================================================================
Expand Down Expand Up @@ -360,6 +335,14 @@ public void setCurrentRunway(Runway runway) {

// Update selected box
runwayDroplist.setValue(runway.getName());

// Enable / Disable Reciprocal Button

if(runway.getReciprocalRunway() == null){
switchButton.disableProperty().setValue(true);
}else{
switchButton.disableProperty().setValue(false);
}
}

public void makeNotification(String title, String text, Image icon) {
Expand Down