Skip to content

Commit

Permalink
Merge pull request #278 from RB9823/master
Browse files Browse the repository at this point in the history
UG, DG and Displaying the UG within the HelpWindow
  • Loading branch information
markgcera authored Nov 12, 2023
2 parents 83d3acb + 4fb8fb0 commit 9c8df4b
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 43 deletions.
58 changes: 42 additions & 16 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,58 @@
layout: page
title: Developer Guide
---

<details open>
<summary><strong>Table of Contents</strong></summary>
<div markdown="1">

* Table of Contents
{:toc}

</div>
</details>

---

<details open>
<summary><strong>Product Description</strong></summary>
<div markdown="1">

CheckMate is a powerful room booking and management system designed for hotel employees, especially those in administrative and management positions. It streamlines the process of room bookings, offering real-time room data visualization, search functionality, and efficient booking management.

</div>
</details>

---

<details open>
<summary><strong>Acknowledgements</strong></summary>
<div markdown="1">

## **Acknowledgements**

* CheckMate logo generated by: [BrandCrowd](https://www.brandcrowd.com/maker/logo/modern-pillar-letter-c-84777?text=CheckMate&isSearch=True)
* Doughnut Chart inspired by and template taken from user`jewelsea`'s comment in this Stack Overflow [post](https://stackoverflow.com/questions/24121580/can-piechart-from-javafx-be-displayed-as-a-doughnut)

</div>
</details>

--------------------------------------------------------------------------------------------------------------------

<details open>
<summary><strong>Setting up, getting started</strong></summary>
<div markdown="1">

## **Setting up, getting started**

Refer to the guide [_Setting up and getting started_](SettingUp.md).

</div>
</details>

--------------------------------------------------------------------------------------------------------------------
<details open>
<summary><strong>Design</strong></summary>
<summary><strong><b>Design</b></strong></summary>
<div markdown="1">

## **Design**
Expand Down Expand Up @@ -107,9 +138,9 @@ The sequence diagram below illustrates the interactions within the `Logic` compo
How the `Logic` component works:

1. When `Logic` is called upon to execute a command, it is passed to an `BookingBookParser` object which in turn creates a parser that matches the command (e.g., `DeleteCommandParser`) and uses it to parse the command.
2.This results in a `Command` object (more precisely, an object of one of its subclasses e.g., `DeleteCommand`) which is executed by the `LogicManager`.
3.The command can communicate with the `Model` when it is executed (e.g. to delete a person).
4.The result of the command execution is encapsulated as a `CommandResult` object which is returned back from `Logic`.
2. This results in a `Command` object (more precisely, an object of one of its subclasses e.g., `DeleteCommand`) which is executed by the `LogicManager`.
3. The command can communicate with the `Model` when it is executed (e.g. to delete a person).
4. The result of the command execution is encapsulated as a `CommandResult` object which is returned back from `Logic`.

Here are the other classes in `Logic` (omitted from the class diagram above) that are used for parsing a user command:

Expand All @@ -124,7 +155,6 @@ How the parsing works:

<img src="images/ModelClassDiagram.png" width="450" />


The `Model` component,

* stores the booking book data i.e., all `Booking` objects (which are contained in a `UniqueBookingList` object).
Expand Down Expand Up @@ -527,19 +557,15 @@ testers are expected to do more *exploratory* testing.
### Launch and shutdown

1. Initial launch
1. Download the jar file and copy into an empty folder
2. Double-click the jar file Expected: Shows the GUI with a set of sample contacts. The window size may not be optimum.

1. Download the jar file and copy into an empty folder

1. Double-click the jar file Expected: Shows the GUI with a set of sample contacts. The window size may not be optimum.

1. Saving window preferences

1. Resize the window to an optimum size. Move the window to a different location. Close the window.

1. Re-launch the app by double-clicking the jar file.<br>
Expected: The most recent window size and location is retained.
2. Saving window preferences
1. Resize the window to an optimum size. Move the window to a different location. Close the window.
2. Re-launch the app by double-clicking the jar file.<br>
Expected: The most recent window size and location is retained.

1. _{ more test cases …​ }_
3. _{ more test cases …​ }_

### Adding a Booking

Expand Down
47 changes: 45 additions & 2 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,32 @@ title: User Guide
sidebar: toc
---
# CheckMate User Guide
CheckMate is a **desktop app for streamlining the process of room bookings for hotel employees, optimized for use via a Command Line Interface** (CLI) while still having the benefits of a Graphical User Interface (GUI). If you can type fast, you can maximise real-time room searching, service scheduling, and amenity management. Optimized for administrative roles, it ensures that room allocation and guest needs are seamlessly addressed.

<details open>
<summary><strong>Product Description</strong></summary>
<div markdown="1">

CheckMate is a **desktop app for streamlining the process of room bookings by hotel employees, optimized for use via a Command Line Interface** (CLI) while still having the benefits of a Graphical User Interface (GUI). If you can type fast, you can maximise real-time room searching, service scheduling, and amenity management. Optimized for administrative roles, it ensures that room allocation and guest needs are seamlessly addressed.

</div>
</details>

---

<details open>
<summary><strong>Table of Contents</strong></summary>
<div markdown="1">

## Table of Contents

* Table of Contents
{:toc}

</div>
</details>

---

<details open>
<summary><strong>Quick start</strong></summary>
<div markdown="1">
Expand All @@ -28,7 +46,7 @@ CheckMate is a **desktop app for streamlining the process of room bookings for h
A GUI similar to the below should appear in a few seconds. Note how the app contains some sample data.<br>
![LandingGUI](images/Ui.png)

5. Clicking on a booking will allow you to see its details.
5. Double-clicking on a booking will allow you to see its details.
![ClickBooking.png](images%2FClickBooking.png)

6. Here is a quick summary of the Graphical User Interface (GUI), or what you can see on your screen right now.
Expand All @@ -55,6 +73,7 @@ CheckMate is a **desktop app for streamlining the process of room bookings for h
</details>

---

<details open>
<summary><strong>Formats</strong></summary>
<div markdown="1">
Expand Down Expand Up @@ -248,21 +267,40 @@ Prefix completions works with `add` and `edit` command and does not validate you

</div>
</details>

--------------------------------------------------------------------------------------------------------------------

<details open>
<summary><strong>FAQ</strong></summary>
<div markdown="1">

## FAQ

**Q**: How do I transfer my data to another Computer?<br>
**A**: Install the app in the other computer and overwrite the empty data file it creates with the file that contains the data of your previous CheckMate home folder.

</div>
</details>

--------------------------------------------------------------------------------------------------------------------

<details open>
<summary><strong>Known Issues</strong></summary>
<div markdown="1">

## Known Issues

1. **When using multiple screens**, if you move the application to a secondary screen, and later switch to using only the primary screen, the GUI will open off-screen. The remedy is to delete the `preferences.json` file created by the application before running the application again.

</div>
</details>

--------------------------------------------------------------------------------------------------------------------

<details open>
<summary><strong>Commands Summary</strong></summary>
<div markdown="1">

## Commands Summary

| Action | Format, Examples |
Expand All @@ -276,3 +314,8 @@ Prefix completions works with `add` and `edit` command and does not validate you
| **List** | `list` |
| **Help** | `help` |
| **Exit** | `exit` |

</div>
</details>

--------------------------------------------------------------------------------------------------------------------
7 changes: 3 additions & 4 deletions src/main/java/seedu/address/ui/HelpWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

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.scene.web.WebView;
import javafx.stage.Stage;
import seedu.address.commons.core.LogsCenter;

Expand All @@ -16,7 +16,6 @@
public class HelpWindow extends UiPart<Stage> {

public static final String USERGUIDE_URL = "https://ay2324s1-cs2103t-f10-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";
Expand All @@ -25,7 +24,7 @@ public class HelpWindow extends UiPart<Stage> {
private Button copyButton;

@FXML
private Label helpMessage;
private WebView webView;

/**
* Creates a new HelpWindow.
Expand All @@ -34,7 +33,7 @@ public class HelpWindow extends UiPart<Stage> {
*/
public HelpWindow(Stage root) {
super(FXML, root);
helpMessage.setText(HELP_MESSAGE);
webView.getEngine().load(USERGUIDE_URL);
}

/**
Expand Down
32 changes: 11 additions & 21 deletions src/main/resources/view/HelpWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,31 @@
<?import javafx.geometry.Insets?>
<?import javafx.scene.Scene?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.web.WebView?>
<?import javafx.stage.Stage?>

<fx:root resizable="false" title="Help" type="javafx.stage.Stage" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
<fx:root resizable="true" title="Help" type="javafx.stage.Stage" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
<icons>
<Image url="@/images/help_icon.png" />
<Image url="@/images/help_icon.png"/>
</icons>
<scene>
<Scene>
<stylesheets>
<URL value="@HelpWindow.css" />
<URL value="@HelpWindow.css"/>
</stylesheets>

<HBox alignment="CENTER" fx:id="helpMessageContainer">
<children>
<Label fx:id="helpMessage" text="Label">
<HBox.margin>
<Insets right="5.0" />
</HBox.margin>
</Label>
<VBox spacing="10" fillWidth="true">
<HBox alignment="CENTER" fx:id="helpMessageContainer">
<Button fx:id="copyButton" mnemonicParsing="false" onAction="#copyUrl" text="Copy URL">
<HBox.margin>
<Insets left="5.0" />
<Insets left="5.0"/>
</HBox.margin>
</Button>
</children>
<opaqueInsets>
<Insets bottom="10.0" left="5.0" right="10.0" top="5.0" />
</opaqueInsets>
<padding>
<Insets bottom="10.0" left="5.0" right="10.0" top="5.0" />
</padding>
</HBox>
</HBox>
<WebView fx:id="webView" VBox.vgrow="ALWAYS"/>
</VBox>
</Scene>
</scene>
</fx:root>

0 comments on commit 9c8df4b

Please sign in to comment.