Skip to content

Commit

Permalink
made all alerts resizeable
Browse files Browse the repository at this point in the history
  • Loading branch information
jherman1997 committed Oct 29, 2020
1 parent 2a72bda commit 4b8cccf
Show file tree
Hide file tree
Showing 15 changed files with 12 additions and 0 deletions.
Binary file modified out/STEM.jar
Binary file not shown.
Binary file modified out/classes/Editor$3.class
Binary file not shown.
Binary file modified out/classes/Editor$4$1.class
Binary file not shown.
Binary file modified out/classes/Editor$4.class
Binary file not shown.
Binary file modified out/classes/Editor$5.class
Binary file not shown.
Binary file modified out/classes/Editor$6.class
Binary file not shown.
Binary file modified out/classes/Editor.class
Binary file not shown.
Binary file modified out/classes/SaveLoad.class
Binary file not shown.
Binary file modified out/classes/TransitionEditor$2.class
Binary file not shown.
Binary file modified out/classes/TransitionEditor$3.class
Binary file not shown.
Binary file modified out/classes/TransitionEditor$4.class
Binary file not shown.
Binary file modified out/classes/TransitionEditor.class
Binary file not shown.
6 changes: 6 additions & 0 deletions src/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,7 @@ else if (new_toggle.getUserData() == "Add Transition"){

// alert the user
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setResizable(true);
alert.setTitle("Transition Exists");
alert.setContentText("That transition already exists! Please try again.");
alert.showAndWait();
Expand Down Expand Up @@ -1232,6 +1233,7 @@ private void editTape(Stage window, Machine currentMachine) {
}
else {
Alert alert = new Alert(Alert.AlertType.WARNING);
alert.setResizable(true);
alert.setTitle("Invalid character(s)");
alert.setContentText("You input invalid character(s) in your tape.");
alert.initOwner(window);
Expand Down Expand Up @@ -1336,6 +1338,7 @@ else if(keyEvent.getCode() == KeyCode.RIGHT) {

if(next == null) {
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setResizable(true);
alert.initOwner(window);
alert.initModality(Modality.APPLICATION_MODAL);
alert.setTitle("The machine has finished");
Expand Down Expand Up @@ -1485,6 +1488,7 @@ public Void call() {
public void run() {

Alert debugLog = new Alert(Alert.AlertType.ERROR);
debugLog.setResizable(true);
debugLog.initOwner(window);
debugLog.initModality(Modality.APPLICATION_MODAL);
ButtonType moreDebug = new ButtonType("Continue with breakpoint set");
Expand Down Expand Up @@ -1569,6 +1573,7 @@ else if (keyEvent.getCode() == KeyCode.DOWN) {
currentMachine.getTape().refreshTapeDisplay();

Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setResizable(true);
alert.initOwner(window);
alert.initModality(Modality.APPLICATION_MODAL);
alert.setTitle("The machine has finished");
Expand Down Expand Up @@ -1931,6 +1936,7 @@ private void redrawAllPaths(){
public void showException(Exception e){
System.out.println(e);
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setResizable(true);
alert.initOwner(window);
alert.initModality(Modality.APPLICATION_MODAL);
alert.setTitle("An Exception has Occurred!");
Expand Down
3 changes: 3 additions & 0 deletions src/SaveLoad.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public boolean saveMachine(Window window, Machine m){
catch (IOException e) {
/* Error occured during saving. */
Alert saveError = new Alert(Alert.AlertType.ERROR);
saveError.setResizable(true);
saveError.initOwner(window);
saveError.initModality(Modality.APPLICATION_MODAL);
saveError.setTitle("Error Saving");
Expand Down Expand Up @@ -107,6 +108,7 @@ public Machine loadMachine(Window window){
} else {
// Not a valid header format, display a message and return false
Alert invalidFileType = new Alert(Alert.AlertType.INFORMATION);
invalidFileType.setResizable(true);
invalidFileType.setTitle("Invalid File");
invalidFileType.setHeaderText("Incorrect File header.");
invalidFileType.initOwner(window);
Expand All @@ -119,6 +121,7 @@ public Machine loadMachine(Window window){
catch (Exception e) {
/* Error occured. */
Alert fileError = new Alert(Alert.AlertType.ERROR);
fileError.setResizable(true);
fileError.setTitle("File Error");
fileError.setHeaderText("Ran into a problem loading that file!");
fileError.setContentText(e.getMessage());
Expand Down
3 changes: 3 additions & 0 deletions src/TransitionEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ public void handle(CellEditEvent<Transition, String> t) {
}
else{
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setResizable(true);
alert.initOwner(window);
alert.initModality(Modality.APPLICATION_MODAL);
alert.setTitle("Incorrect Transition");
Expand All @@ -288,6 +289,7 @@ public void handle(CellEditEvent<Transition, String> t) {
}
else{
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setResizable(true);
alert.initOwner(window);
alert.initModality(Modality.APPLICATION_MODAL);
alert.setTitle("Incorrect Transition");
Expand Down Expand Up @@ -316,6 +318,7 @@ public void handle(CellEditEvent<Transition, String> t) {
System.out.println("This is our value: " + t.getNewValue());
System.out.println("This is our length: " + t.getNewValue().length());
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setResizable(true);
alert.initOwner(window);
alert.initModality(Modality.APPLICATION_MODAL);
alert.setTitle("Incorrect Transition");
Expand Down

0 comments on commit 4b8cccf

Please sign in to comment.