From 6fb0493bfbc4e0cef01283230f38ab02d28ffeff Mon Sep 17 00:00:00 2001 From: Guo Wei Date: Wed, 12 Oct 2022 19:32:03 +0800 Subject: [PATCH] remove unnecessary files --- .../java/seedu/address/ui/HelpWindow.java | 102 ------------------ .../java/seedu/address/ui/MainWindow.java | 13 +-- src/main/resources/view/HelpWindow.css | 19 ---- src/main/resources/view/HelpWindow.fxml | 44 -------- 4 files changed, 1 insertion(+), 177 deletions(-) delete mode 100644 src/main/java/seedu/address/ui/HelpWindow.java delete mode 100644 src/main/resources/view/HelpWindow.css delete mode 100644 src/main/resources/view/HelpWindow.fxml diff --git a/src/main/java/seedu/address/ui/HelpWindow.java b/src/main/java/seedu/address/ui/HelpWindow.java deleted file mode 100644 index cf8bc05b8ed..00000000000 --- a/src/main/java/seedu/address/ui/HelpWindow.java +++ /dev/null @@ -1,102 +0,0 @@ -package seedu.address.ui; - -import java.util.logging.Logger; - -import javafx.fxml.FXML; -import javafx.scene.control.Button; -import javafx.scene.control.Label; -import javafx.scene.input.Clipboard; -import javafx.scene.input.ClipboardContent; -import javafx.stage.Stage; -import seedu.address.commons.core.LogsCenter; - -/** - * Controller for a help page - */ -public class HelpWindow extends UiPart { - - public static final String USERGUIDE_URL = "https://ay2223s1-cs2103t-t17-1.github.io/tp/UserGuide.html"; - public static final String HELP_MESSAGE = "Refer to the user guide: " + USERGUIDE_URL; - - private static final Logger logger = LogsCenter.getLogger(HelpWindow.class); - private static final String FXML = "HelpWindow.fxml"; - - @FXML - private Button copyButton; - - @FXML - private Label helpMessage; - - /** - * Creates a new HelpWindow. - * - * @param root Stage to use as the root of the HelpWindow. - */ - public HelpWindow(Stage root) { - super(FXML, root); - helpMessage.setText(HELP_MESSAGE); - } - - /** - * Creates a new HelpWindow. - */ - public HelpWindow() { - this(new Stage()); - } - - /** - * Shows the help window. - * @throws IllegalStateException - * - */ - public void show() { - logger.fine("Showing help page about the application."); - getRoot().show(); - getRoot().centerOnScreen(); - } - - /** - * Returns true if the help window is currently being shown. - */ - public boolean isShowing() { - return getRoot().isShowing(); - } - - /** - * Hides the help window. - */ - public void hide() { - getRoot().hide(); - } - - /** - * Focuses on the help window. - */ - public void focus() { - getRoot().requestFocus(); - } - - /** - * Copies the URL to the user guide to the clipboard. - */ - @FXML - private void copyUrl() { - final Clipboard clipboard = Clipboard.getSystemClipboard(); - final ClipboardContent url = new ClipboardContent(); - url.putString(USERGUIDE_URL); - clipboard.setContent(url); - } -} diff --git a/src/main/java/seedu/address/ui/MainWindow.java b/src/main/java/seedu/address/ui/MainWindow.java index c3384e3291f..5db82117724 100644 --- a/src/main/java/seedu/address/ui/MainWindow.java +++ b/src/main/java/seedu/address/ui/MainWindow.java @@ -34,7 +34,6 @@ public class MainWindow extends UiPart { // Independent Ui parts residing in this Ui container private PersonListPanel personListPanel; private ResultDisplay resultDisplay; - private HelpWindow helpWindow; @FXML private StackPane commandBoxPlaceholder; @@ -65,8 +64,6 @@ public MainWindow(Stage primaryStage, Logic logic) { setWindowDefaultSize(logic.getGuiSettings()); setAccelerators(); - - helpWindow = new HelpWindow(); } public Stage getPrimaryStage() { @@ -137,19 +134,12 @@ private void setWindowDefaultSize(GuiSettings guiSettings) { } /** - * Opens the help window or focuses on it if it's already opened. + * Opens the help window in a new browser window */ @FXML public void handleHelp() { UrlLauncher helpController = new UrlLauncher(); helpController.launchWebPage(USERGUIDE_URL); - /* - if (!helpWindow.isShowing()) { - helpWindow.show(); - } else { - helpWindow.focus(); - } - */ } void show() { @@ -164,7 +154,6 @@ private void handleExit() { GuiSettings guiSettings = new GuiSettings(primaryStage.getWidth(), primaryStage.getHeight(), (int) primaryStage.getX(), (int) primaryStage.getY()); logic.setGuiSettings(guiSettings); - helpWindow.hide(); primaryStage.hide(); } diff --git a/src/main/resources/view/HelpWindow.css b/src/main/resources/view/HelpWindow.css deleted file mode 100644 index 17e8a8722cd..00000000000 --- a/src/main/resources/view/HelpWindow.css +++ /dev/null @@ -1,19 +0,0 @@ -#copyButton, #helpMessage { - -fx-text-fill: white; -} - -#copyButton { - -fx-background-color: dimgray; -} - -#copyButton:hover { - -fx-background-color: gray; -} - -#copyButton:armed { - -fx-background-color: darkgray; -} - -#helpMessageContainer { - -fx-background-color: derive(#1d1d1d, 20%); -} diff --git a/src/main/resources/view/HelpWindow.fxml b/src/main/resources/view/HelpWindow.fxml deleted file mode 100644 index 5dea0adef70..00000000000 --- a/src/main/resources/view/HelpWindow.fxml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -