Project: Tourist-Book

Code contributed: [Functional code] [Test code]

Enhancement Added: Displaying of Mrt Map

External behavior


Start of Extract [from: User Guide]

Display MRT map of Singapore by clicking on MRT MapMRT Map

or

Display MRT map of Singapore by using the CLI.
Format: mrt

or

Using the shortcut key F3

  • The browser window must be closed before proceeding with any other command. This is a bug that is found in
    the base Addressbook-level 4.

  • The command is case sensitive

  • The command will ignore any other parameters after the command word.

  • It is also not an undoable command, hence the undo command will not work.

End of Extract


Justification

Since the project is targeted to the tourist who are visiting Singapore, it is important for them to have easy access to the MRT map of Singapore.

Implementation


Start of Extract [from: Developer Guide]

MRT Map mechanism

MRT Map mechanism displays the latest Singapore MRT map from LTA website using the browser display. It can be access by using Command Line and UI. Figure 3.4.1 shows the new structure of the UI component.

UiComponentwithMrtClassDiagram

Figure 3.6.1 : Structure of the UI Component with MRTWindow

Command mrt is used to open mrt map window from Command Line. Following Figure 3.4.2 shows the sequence when mrt is key in by the user.

MRTSequenceDiagrams

Figure 3.6.2 : Structure of the UI Component with MRTWindow

public static final String MRT_FILE_PATH = "/docs/MrtMap.jpg";

private static final Logger logger = LogsCenter.getLogger(MrtWindow.class);
private static final String ICON = "/images/mrt_logo.jpg";
private static final String FXML = "MrtMapWindow.fxml";
private static final String TITLE = "MRT Map";

The code above shows the setting up of MrtWindow.java for MrtWindow Browser.

MrtMapButtonUI

Figure 3.6.3 : UI button added to the `MainWindow`

Design Considerations

Aspect: Different approach on displaying mrt map
Alternative 1: Access from the internet
Pros: Can get the latest information and easier to implement as using the web browser+ Cons: Slow in accessing the web page and its depending on the internet speed
Alternative 2 (current choice): Include MRT map picture
Pros: Load faster in accessing the map
Cons: Might not be the latest one. However, this can overcome with frequent updates.

  • (Pull requests #10)

End of Extract


Enhancement Added: Sorrting

External behavior


Start of Extract [from: User Guide]

Sort command allows you to sort the places in alphabetical order.
Format: sort

  • The sort command is temporary and does not permanently sort the places by alphabetical order.

  • The command is case sensitive

  • The command will ignore any other parameters after the command word.

End of Extract


Justification

The list of Places that added to the list will appear at the bottom of the list. By sorting the list, it allows the user to view the list in alphabetical order.

Implementation


Start of Extract [from: Developer Guide]

Sort Mechanism

Sort mechanism operates by sorting the internalList in UniquePersonList. This command allows the user to sort the list in alphebitacal orders. Sort command will inherit from commands.

Following is the sequence diagram of sort command.

SortCommandSequenceDiagram

Figure 3.7.1 : Sequence diagram of sort command

@Override
public int compareTo(Place otherPlace) {
    int toUpdate = this.name.toString().toUpperCase().compareTo((otherPlace.name.toString().toUpperCase()));
    return toUpdate;
}

The code above shows the implementation of compareTo method. This method converts the names of the Places to CAPITAL LETTERS, which allows us to compare easily. After the end of the comparison it will return the most updated list of places to display.

  • (Pull requests #92)

End of Extract


Enhancement Added: Short Commands

External behavior


Start of Extract [from: User Guide]

Logic component

Added a shorthand equivalent alias for each of the individual commands. For example, besides typing add, the user can also type a to remove all places in the list.

  • (Pull requests #4)

End of Extract


Enhancement Added: Displaying of PSI value

External behavior


Start of Extract [from: User Guide]

Displays the current PSI levels in Singapore.
Format: psi

  • The command is case sensitive

  • The command will ignore any other parameters after the command word.

  • It is also not an undoable command, hence the undo command will not work.

  • (Pull requests #74)

End of Extract


Enhancement Added: Allowing the tourist to just input 2 compulsory fields

External behavior


Start of Extract [from: User Guide]

Tourist can opt to leave Address, Email and Phone field empty when adding in new attraction.

For Example: * Instead of: add n/Marina Bay Sands ph/698837 /https://www.marinabay.com.sg a/10 Bayfront Avenue p/018956 * User to can key in: add n/Marina Bay Sands p/018956

If the user left as blank the default values are as follow:
- Phone: 000
- Address: -
- Website http://www.-.com

  • (Pull requests #57)

End of Extract


Other contributions

  • Created new attributes (Pull requests #26)

  • Help to find bugs for other projects during Acceptance testing:
    (Issues Trackers #121, #120, #119, #122)