Skip to content

Commit

Permalink
Minor modifications to GUI and align to coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
RiyaMehta2211 committed Sep 21, 2023
1 parent b663dda commit 44b052e
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 10 deletions.
Binary file modified docs/Ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions src/main/java/duke/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ private static void updateTask(String str, TaskList tasks) throws InvalidInputEx
throw new InvalidInputException(str);
}
temp = Ui.printUpdatedTask(task);

}
/**
* Updates a task list based on the provided input string.
Expand All @@ -91,8 +90,7 @@ private static void updateList(String str, TaskList tasks) throws InvalidInputEx
tasks.markDone(i);
}
temp = Ui.printAllDone(tasks);
}
else {
} else {
String num = str.substring(5);
if (num.trim().isEmpty()) {
throw new EmptyInputException();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/duke/exception/EmptyInputException.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public class EmptyInputException extends Exception{
public EmptyInputException() {
super("\n\tAccio error! Description, index or date entered cannot be empty!" +
super("\n\tAccio error! Description, index or date entered cannot be empty! " +
"Type 'help' to see the list of valid inputs and the expected formats! ");
}
}
1 change: 0 additions & 1 deletion src/main/java/duke/ui/DialogBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ private DialogBox(String text, Image img) {
} catch (IOException e) {
e.printStackTrace();
}

dialog.setText(text);
displayPicture.setImage(img);
}
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/duke/ui/Ui.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ public static String printDone(Task done) {
"as done:" + "\n" +
"\t " + done.taskString();
}
/**
* Generates a message to indicate that a task has been updated.
*
* @param updated The task that was updated.
* @return A message indicating the task has been updated.
*/
public static String printUpdatedTask(Task updated) {
return "\t" + "Nice! I've updated this task: " +
"\n" +
Expand Down Expand Up @@ -172,7 +178,6 @@ public static String printHelp() {
+ "9. list: shows the existing list of tasks\n"
+ "10. find <keyword>: returns a new list of tasks containing the matching keyword in the task description\n"
+ "11. bye: displays a goodbye message. ";

}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/view/DialogBox.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
maxWidth="1.7976931348623157E308" prefWidth="400.0" type="javafx.scene.layout.HBox" xmlns="http://javafx.com/javafx/11" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Label fx:id="dialog" text="Label" wrapText="true"
style = "-fx-background-radius: 10; -fx-background-color: rgba(188, 193, 194, 0.57)" textFill="antiquewhite">
style = "-fx-background-radius: 10; -fx-background-color: rgba(188, 193, 194, 0.5)" textFill="antiquewhite">
<font>
<Font name = "Apple Chancery" size = "13.5"/>
<Font name = "Times New Roman" size = "14"/>
</font>
<padding>
<Insets bottom="10.0" top="10.0" left = "15.0" right = "20.0" />
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/view/MainWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
-fx-text-fill: #FFBF00; -fx-prompt-text-fill:#FFBF00; -fx-border-width: 2.5px;"
AnchorPane.bottomAnchor="1.0" promptText="Sort your tasks like a Sorting Hat!" >
<font>
<Font name = "Apple Chancery" size = "13.5" />
<Font name = "Times New Roman" size = "14" />
</font>
</TextField>
<Button fx:id="sendButton" contentDisplay="CENTER" layoutX="324.0" layoutY="558.0"
style = "-fx-background-radius: 20.0; -fx-background-color: #FFBF00;
-fx-border-radius: 20.0" mnemonicParsing="false"
onAction="#handleUserInput" prefHeight="38.0" prefWidth="76.0" text="⚡ Send ⚡" textFill="black">
<font>
<Font name = "Apple Chancery" size = "13.5"/>
<Font name = "Times New Roman Bold" size = "14"/>
</font>
</Button>
<ScrollPane fx:id="scrollPane" hbarPolicy="NEVER" hvalue="1.0" prefHeight="557.0" prefWidth="400.0"
Expand Down

0 comments on commit 44b052e

Please sign in to comment.