Skip to content

Commit

Permalink
Merge pull request #191 from AY2223S1-CS2103T-F11-1/update-help-summary
Browse files Browse the repository at this point in the history
Update Help Summary window
  • Loading branch information
chengda300 authored Oct 28, 2022
2 parents c7a23f8 + 77c6c6b commit 9d37458
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class LinkCommand extends Command {
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Links a Person and an Internship. "
+ "Parameters: "
+ PREFIX_PERSON + "PERSON_INDEX "
+ PREFIX_INTERNSHIP + "INTERNSHIP_ID "
+ PREFIX_INTERNSHIP + "INTERNSHIP_ID\n"
+ "Example: " + COMMAND_WORD + " "
+ PREFIX_PERSON + "0 "
+ PREFIX_INTERNSHIP + "0 ";
Expand Down
45 changes: 39 additions & 6 deletions src/main/java/seedu/address/ui/HelpWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,27 @@
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.control.TextArea;
import javafx.scene.input.Clipboard;
import javafx.scene.input.ClipboardContent;
import javafx.stage.Stage;
import seedu.address.commons.core.LogsCenter;
import seedu.address.logic.commands.AddInternshipCommand;
import seedu.address.logic.commands.AddPersonCommand;
import seedu.address.logic.commands.ClearCommand;
import seedu.address.logic.commands.DeleteInternshipCommand;
import seedu.address.logic.commands.DeletePersonCommand;
import seedu.address.logic.commands.EditInternshipCommand;
import seedu.address.logic.commands.EditPersonCommand;
import seedu.address.logic.commands.ExitCommand;
import seedu.address.logic.commands.FindInternshipCommand;
import seedu.address.logic.commands.FindPersonCommand;
import seedu.address.logic.commands.HelpCommand;
import seedu.address.logic.commands.LinkCommand;
import seedu.address.logic.commands.ListInternshipCommand;
import seedu.address.logic.commands.ListPersonCommand;
import seedu.address.logic.commands.SortInternshipCommand;
import seedu.address.logic.commands.SortPersonCommand;

/**
* Controller for a help page
Expand All @@ -19,19 +34,36 @@ public class HelpWindow extends UiPart<Stage> {

public static final String USERGUIDE_URL = "https://ay2223s1-cs2103t-f11-1.github.io/tp/UserGuide.html";
public static final String HELP_MESSAGE = "Refer to the user guide for full details: " + USERGUIDE_URL
+ "\nA summary of the command is provided below for convenience.";
public static final Image HELP_SUMMARY = new Image("/images/help_summary.png");
+ "\nA summary of commands is provided below for convenience.";
private static final Logger logger = LogsCenter.getLogger(HelpWindow.class);
private static final String FXML = "HelpWindow.fxml";

private static final String COMMAND_SUMMARY = "SUMMARY OF COMMANDS:\n\n"
+ HelpCommand.COMMAND_WORD + ": Opens this help window\n\n"
+ AddPersonCommand.MESSAGE_USAGE + "\n\n"
+ AddInternshipCommand.MESSAGE_USAGE + "\n\n"
+ ListPersonCommand.COMMAND_WORD + ": Lists all persons\n\n"
+ ListInternshipCommand.COMMAND_WORD + ": Lists all internships\n\n"
+ EditPersonCommand.MESSAGE_USAGE + "\n\n"
+ EditInternshipCommand.MESSAGE_USAGE + "\n\n"
+ LinkCommand.MESSAGE_USAGE + "\n\n"
+ FindPersonCommand.MESSAGE_USAGE + "\n\n"
+ FindInternshipCommand.MESSAGE_USAGE + "\n\n"
+ DeletePersonCommand.MESSAGE_USAGE + "\n\n"
+ DeleteInternshipCommand.MESSAGE_USAGE + "\n\n"
+ SortPersonCommand.MESSAGE_USAGE + "\n\n"
+ SortInternshipCommand.MESSAGE_USAGE + "\n\n"
+ ClearCommand.COMMAND_WORD + ": Clears all entries\n\n"
+ ExitCommand.COMMAND_WORD + ": Exits the program";

@FXML
private Button copyButton;

@FXML
private Label helpMessage;

@FXML
private ImageView helpImage;
private TextArea commandSummaryDisplay;

/**
* Creates a new HelpWindow.
Expand All @@ -41,7 +73,8 @@ public class HelpWindow extends UiPart<Stage> {
public HelpWindow(Stage root) {
super(FXML, root);
helpMessage.setText(HELP_MESSAGE);
helpImage.setImage(HELP_SUMMARY);

commandSummaryDisplay.setText(COMMAND_SUMMARY);
}

/**
Expand Down
12 changes: 11 additions & 1 deletion src/main/resources/view/HelpWindow.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
-fx-background-color: darkgray;
}

#helpMessageContainer {
#helpContainer, #helpMessageContainer {
-fx-background-color: derive(#1d1d1d, 20%);
}

#commandSummaryDisplay {
-fx-font-family: "Segoe UI Light";
-fx-font-size: 12pt;
-fx-text-fill: white;
}

.text-area .content {
-fx-background-color: derive(#1d1d1d, 20%);
}
7 changes: 5 additions & 2 deletions src/main/resources/view/HelpWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
<?import javafx.scene.layout.HBox?>
<?import javafx.stage.Stage?>

<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.layout.StackPane?>
<fx:root resizable="false" title="Help" type="javafx.stage.Stage" xmlns="http://javafx.com/javafx/11" xmlns:fx="http://javafx.com/fxml/1">
<icons>
<Image url="@/images/help_icon.png" />
Expand Down Expand Up @@ -42,7 +43,9 @@
<Insets bottom="10.0" left="5.0" right="10.0" top="5.0" />
</padding>
</HBox>
<ImageView fx:id="helpImage" />
<StackPane xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1">
<TextArea fx:id="commandSummaryDisplay" editable="false" wrapText="true" />
</StackPane>
</VBox>
</Scene>
</scene>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/view/MainWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<scene>
<Scene fx:id="mainScene">
<stylesheets>
<URL fx:id="darkTheme" value="@DarkTheme.css" />
<URL fx:id="lightTheme" value="@LightTheme.css" />
<URL fx:id="darkTheme" value="@DarkTheme.css" />
<URL fx:id="extensions" value="@Extensions.css" />
</stylesheets>

Expand Down

0 comments on commit 9d37458

Please sign in to comment.