Skip to content

Commit

Permalink
Remove UI dependency on MainApp
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanyee33 committed Apr 14, 2024
1 parent 65573e6 commit ec4f465
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/seedu/address/ui/UiManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import javafx.scene.image.Image;
import javafx.scene.text.Font;
import javafx.stage.Stage;
import seedu.address.MainApp;
import seedu.address.commons.core.LogsCenter;
import seedu.address.commons.util.StringUtil;
import seedu.address.logic.Logic;
Expand All @@ -22,6 +21,7 @@ public class UiManager implements Ui {

private static final Logger logger = LogsCenter.getLogger(UiManager.class);
private static final String ICON_APPLICATION = "/images/icon_title.png";
private static final String CUSTOM_FONT = "/styles/JetBrainsMono-SemiBold.ttf";

private final Logic logic;
private MainWindow mainWindow;
Expand All @@ -41,7 +41,7 @@ public void start(Stage primaryStage) {
primaryStage.getIcons().add(getImage(ICON_APPLICATION));

// Load custom fonts
Font.loadFont(getClass().getResourceAsStream("/styles/JetBrainsMono-SemiBold.ttf"), 16);
Font.loadFont(getClass().getResourceAsStream(CUSTOM_FONT), 16);

Check warning on line 44 in src/main/java/seedu/address/ui/UiManager.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/seedu/address/ui/UiManager.java#L44

Added line #L44 was not covered by tests

try {
mainWindow = new MainWindow(primaryStage, logic);
Expand All @@ -52,7 +52,7 @@ public void start(Stage primaryStage) {
}

private Image getImage(String imagePath) {
return new Image(MainApp.class.getResourceAsStream(imagePath));
return new Image(getClass().getResourceAsStream(imagePath));

Check warning on line 55 in src/main/java/seedu/address/ui/UiManager.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/seedu/address/ui/UiManager.java#L55

Added line #L55 was not covered by tests
}

void showAlertDialogAndWait(Alert.AlertType type, String title, String headerText, String contentText) {
Expand Down

0 comments on commit ec4f465

Please sign in to comment.