Skip to content

Commit

Permalink
Better code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
tah5in committed Mar 3, 2024
1 parent c6fbb9b commit 1066bae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/java/dude/Dude.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public String getResponse(String input) {
Command c = Parser.parse(input, taskList);
String response = executeCommand(c);
try {
saveToDisk();
saveTaskListToDisk();
} catch (IOException e) {
return STORAGE_SAVING_ERROR_MESSAGE;
}
Expand All @@ -63,7 +63,7 @@ private static String executeCommand(Command command) {
}
}

private void saveToDisk() throws IOException, SecurityException {
private void saveTaskListToDisk() throws IOException, SecurityException {
this.storage.saveTasks(taskList);
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/dude/gui/DialogBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.geometry.Pos;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.HBox;

// @@author Jeffry Lum
// Solution below is reused from https://se-education.org/guides/tutorials/javaFxPart4.html
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/dude/gui/MainView.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public class MainView extends AnchorPane {
private Image dudeImage;
private Dude dude;

/**
* Initializes the MainView, setting up the images and the Dude object.
*/
@FXML
public void initialize() {
this.dude = new Dude("data/tasks.ser");
Expand Down

0 comments on commit 1066bae

Please sign in to comment.