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 Map
→ MRT Map
or
Display MRT map of Singapore by using the CLI.
Format: mrt
or
Using the shortcut key F3
|
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.
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.
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.
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.
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
|
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.
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.
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
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
|
-
(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