Skip to content

Commit 5654910

Browse files
authored
Merge pull request #113 from Maurice2n97/update-UG-1.3
Update ug 1.3
2 parents 6ed3082 + 7132656 commit 5654910

8 files changed

Lines changed: 88 additions & 25 deletions

File tree

docs/UserGuide.md

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,45 @@ Format: `sortp by/FIELD d/DIRECTION`
171171
* Sort by ascending alphabetical order : `ASC`
172172
* Sort by descending alphabetical order : `DESC`
173173

174+
Examples
175+
176+
##Timetable feature
177+
178+
### Viewing Timetable:
179+
No command is necessary. Just click on the timetable tab to switch view from meeting list to timetable. The timetable
180+
consists of 7 rows, each row corresponds a day of a week in the timetable, which default is from 7 am to 6.59 am on the next day.
181+
Each meeting is represented as an orange rectangular slot that will be placed in the timetable according to the following rules
182+
183+
* If the meetings happen on a date corresponding to a column, it will be slotted into that column
184+
* The vertical axis if the timetable is the time, and slots are vertically placed according to their start time.
185+
* The length of the meeting slot is proportional to the timespan of the meeting.
186+
187+
Note that it will correctly update and display all meetings. Meetings that fall outside the range of the timetable
188+
will be filtered off. Some things to note:
189+
190+
* Default when starting the application, the timetable will have the first ( leftmost column ) representing today's date.
191+
* Meetings can overlap across columns.
192+
* Setting small meeting times around the edge of the timetable will cause display issues, For example, setting a meeting
193+
to 6:44-7:01 might cause display issues from the 7 - 7.01 will not display the date or time.
194+
* Note that you can scroll to view more slots.
195+
196+
197+
### Set timetable date : `setTimetable`
198+
199+
Sets a timetable to start on a specified date. Updates the display accordingly.
200+
201+
Format: 'setTimetable DATE'
202+
203+
* DATE must be a string strictly following the format `YYYY-mm-dd`
204+
205+
206+
### Profile picture:
207+
208+
Gets the image of contacts from Gravatar. If contact does not have a gravatar account linked to
209+
the email address, the what will be shown is a unique robo-hashed image obtained from email.
210+
There is no need to use any commands, the profile picture will be shown after updating/ adding contact
211+
If there is a problem establishing connection to the server, a default blue circle icon will be displayed
212+
instead.
174213

175214
### Clearing all entries : `clear`
176215

@@ -186,11 +225,12 @@ Format: `exit`
186225

187226
### Saving the data
188227

189-
AddressBook data are saved in the hard disk automatically after any command that changes the data. There is no need to save manually.
228+
MeetBuddy data are saved in the hard disk automatically after any command that changes the data. There is no need to save manually.
190229

191230
### Editing the data file
192231

193232
AddressBook data are saved as a JSON file `[JAR file location]/data/addressbook.json`. Advanced users are welcome to update data directly by editing that data file.
233+
MeetingBook data are saved as a JSON file '[JAR file location]/data/meetingbook.json'. Advanced users are welcome to update data directly by editing that data file.
194234

195235
<div markdown="span" class="alert alert-warning">:exclamation: **Caution:**
196236
If your changes to the data file makes its format invalid, AddressBook will discard all data and start with an empty data file at the next run.
@@ -200,7 +240,9 @@ If your changes to the data file makes its format invalid, AddressBook will disc
200240

201241
### Adding a meeting: `addm`
202242

203-
Adds a meeting to MeetBuddy.
243+
Adds a meeting to MeetBuddy. Note that meetings must be of minimum length of 15 mins
244+
and maximum length of 7 days. For example a meeting cannot be 15 March 16:00 - 22 March 16:00,
245+
but can be from 15 March 16:00 - 22 march 15:59.
204246

205247
Format: `addm n/NAME st/TIME ed/TIME des/DESCRIPTIONS pr/PRIORITY [p/PERSON RELATED]… [g/GROUP]…​`
206248

@@ -287,3 +329,4 @@ Action | Format, Examples
287329
**List** | `list`, `listm`, `listp`
288330
**Sort** | `sortp by/FIELD d/DIRECTION` <br> `sortm by/FIELD d/DIRECTION`
289331
**Help** | `help`
332+
**SetTimtable**| `setTimetable DATE`

docs/images/Ui.png

-75.3 KB
Loading

src/main/java/seedu/address/model/meeting/Meeting.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import seedu.address.model.person.UniquePersonList;
77
import seedu.address.model.schedule.Schedulable;
88

9+
import java.time.Duration;
910
import java.time.LocalDateTime;
1011
import java.util.Collections;
1112
import java.util.HashSet;
@@ -23,7 +24,9 @@
2324
public class Meeting implements Schedulable {
2425

2526
public static final String MESSAGE_CONSTRAINTS =
26-
"The start date time of a meeting should be strictly earlier than the terminate date time.";
27+
"The start date time of a meeting should be strictly earlier than the terminate date time. A meeting "
28+
+ "should be at least 15 minutes long. A meeting should be at most one week long. For example:"
29+
+ "If the meeting starts on 15 August 7:00 am, it should be at note end later than 22 Aug 6:59am";
2730

2831

2932
// Identity fields
@@ -95,10 +98,13 @@ public boolean isSameMeeting(Meeting otherMeeting) {
9598
&& otherMeeting.getTerminate().equals(getTerminate());
9699
}
97100
/**
98-
* Returns true if a given date time for the meeting is valid.
101+
* Returns true if a given date time for the meeting is valid. Note the meeting must be at
102+
* least 15 mins long and at most 7 days long.
99103
*/
100104
public static boolean isValidStartTerminate(DateTime start, DateTime terminate) {
101-
return start.compareTo(terminate) < 0;
105+
long minutesBetween = Duration.between(start.toLocalDateTime(), terminate.toLocalDateTime()).toMinutes();
106+
long daysBetween = Duration.between(start.toLocalDateTime(), terminate.toLocalDateTime()).toDays();
107+
return start.compareTo(terminate) < 0 && (minutesBetween >= 15) && (daysBetween < 7);
102108
}
103109
/**
104110
* Adds new groups from a set. Merge if new group appears.

src/main/java/seedu/address/ui/TimetablePlacementPolicy.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@
3131
*/
3232
public class TimetablePlacementPolicy {
3333

34-
private static final int MINUTES_IN_AN_HOUR = 60;
35-
private static final int MINUTES_IN_DAY = 2400;
34+
private static final int SECONDS_IN_A_MINUTE = 60;
35+
private static final int SECONDS_IN_AN_HOUR = 3600;
36+
private static final long SECONDS_IN_DAY = 86400;
3637

3738
public static final double TIMETABLE_DISPLAY_SIZE = 5760;
3839

@@ -104,19 +105,19 @@ public TimetableView.Column getColumnPlacement(Schedulable schedulable) {
104105
}
105106

106107
/**
107-
* Gets the number of minutes so far in a day, starting from 00:00
108+
* Gets the number of seconds so far in a day, starting from 00:00
108109
* @param localDateTime
109110
* @return
110111
*/
111112

112-
public static int getMinutesInDay(LocalDateTime localDateTime) {
113-
return localDateTime.getHour() * MINUTES_IN_AN_HOUR + localDateTime.getMinute();
113+
public static int getSecondsInDay(LocalDateTime localDateTime) {
114+
return localDateTime.getHour() * SECONDS_IN_AN_HOUR + localDateTime.getMinute() * SECONDS_IN_A_MINUTE + localDateTime.getSecond();
114115
}
115116

116117
public double getVerticalPosition(Schedulable schedulable) {
117118
LocalDateTime startingDateTime = schedulable.getStartLocalDateTime();
118-
int minutesSoFar = getMinutesInDay(applyOffset(startingDateTime));
119-
double ratio = (double) minutesSoFar / MINUTES_IN_DAY;
119+
int minutesSoFar = getSecondsInDay(applyOffset(startingDateTime));
120+
double ratio = (double) minutesSoFar / SECONDS_IN_DAY;
120121
return ratio * TIMETABLE_DISPLAY_SIZE;
121122
}
122123

@@ -129,10 +130,10 @@ public double getVerticalPosition(Schedulable schedulable) {
129130
public double getLengthOfSlot(Schedulable schedulable) {
130131
LocalDateTime offSetStartDate = applyOffset(schedulable.getStartLocalDateTime());
131132
LocalDateTime offSetEndDate = applyOffset(schedulable.getTerminateLocalDateTime());
132-
int startMinutesSoFar = getMinutesInDay(offSetStartDate);
133-
int endMinutesSoFar = getMinutesInDay(offSetEndDate);
134-
assert endMinutesSoFar >= startMinutesSoFar;
135-
double ratio = (double)(endMinutesSoFar - startMinutesSoFar) / MINUTES_IN_DAY;
133+
long startSecondsSoFar = getSecondsInDay(offSetStartDate);
134+
long endSecondsSoFar = getSecondsInDay(offSetEndDate);
135+
assert endSecondsSoFar >= startSecondsSoFar;
136+
double ratio = (double)(endSecondsSoFar - startSecondsSoFar) / SECONDS_IN_DAY;
136137
return TIMETABLE_DISPLAY_SIZE * ratio;
137138

138139
}

src/main/java/seedu/address/ui/TimetableSlot.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ public class TimetableSlot extends UiPart<Region> {
2424

2525
public TimetableSlot(double slotLength, String header) {
2626
super(FXML);
27-
this.meetingLabel.setText(header);
27+
if (slotLength < 13) {
28+
this.meetingLabel.setText(""); // Prevent overflow of text
29+
} else {
30+
this.meetingLabel.setText(header);
31+
}
2832
meetingSlot.setPrefHeight(slotLength);
2933
meetingSlot.setMinHeight(slotLength);
3034
meetingSlot.setMaxHeight(slotLength);

src/main/resources/view/DarkTheme.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,3 +346,12 @@
346346
-fx-background-radius: 2;
347347
-fx-font-size: 11;
348348
}
349+
350+
.meetingcard-header {
351+
-fx-text-fill: white;
352+
-fx-background-color: #43613d;
353+
-fx-padding: 1 3 1 3;
354+
-fx-border-radius: 2;
355+
-fx-background-radius: 2;
356+
-fx-font-size: 18;
357+
}

src/main/resources/view/MeetingCard.fxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<HBox alignment="CENTER_LEFT" spacing="10.0" VBox.vgrow="NEVER">
1313
<children>
1414
<Label fx:id="id" text="Label"/>
15-
<Label fx:id="name" text="A VERY LONG MEETING" wrapText="true" HBox.hgrow="ALWAYS"/>
15+
<Label fx:id="name" text="A VERY LONG MEETING" wrapText="true" HBox.hgrow="ALWAYS" styleClass="meetingcard-header" stylesheets="@DarkTheme.css"/>
1616
</children>
1717
<padding>
1818
<Insets top="5.0"/>

src/main/resources/view/TimetableWindow.fxml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@
9999
</Label>
100100
</children>
101101
</VBox>
102-
<AnchorPane fx:id="dayScheduleOne" styleClass="even-timetable-row" stylesheets="@Extensions.css" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" />
103-
<AnchorPane fx:id="dayScheduleTwo" styleClass="odd-timetable-row" stylesheets="@Extensions.css" GridPane.columnIndex="1" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" />
104-
<AnchorPane fx:id="dayScheduleThree" styleClass="even-timetable-row" stylesheets="@Extensions.css" GridPane.columnIndex="2" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" />
105-
<AnchorPane fx:id="dayScheduleFour" styleClass="odd-timetable-row" stylesheets="@Extensions.css" GridPane.columnIndex="3" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" />
106-
<AnchorPane fx:id="dayScheduleFive" styleClass="even-timetable-row" stylesheets="@Extensions.css" GridPane.columnIndex="4" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" />
107-
<AnchorPane fx:id="dayScheduleSix" styleClass="odd-timetable-row" stylesheets="@Extensions.css" GridPane.columnIndex="5" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" />
108-
<AnchorPane fx:id="dayScheduleSeven" styleClass="even-timetable-row" stylesheets="@Extensions.css" GridPane.columnIndex="6" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" />
102+
<AnchorPane fx:id="dayScheduleOne" minHeight="550.0" styleClass="even-timetable-row" stylesheets="@Extensions.css" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" GridPane.vgrow="ALWAYS" />
103+
<AnchorPane fx:id="dayScheduleTwo" minHeight="550.0" styleClass="odd-timetable-row" stylesheets="@Extensions.css" GridPane.columnIndex="1" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" GridPane.vgrow="ALWAYS" />
104+
<AnchorPane fx:id="dayScheduleThree" minHeight="550.0" styleClass="even-timetable-row" stylesheets="@Extensions.css" GridPane.columnIndex="2" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" GridPane.vgrow="ALWAYS" />
105+
<AnchorPane fx:id="dayScheduleFour" minHeight="550.0" styleClass="odd-timetable-row" stylesheets="@Extensions.css" GridPane.columnIndex="3" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" GridPane.vgrow="ALWAYS" />
106+
<AnchorPane fx:id="dayScheduleFive" minHeight="550.0" styleClass="even-timetable-row" stylesheets="@Extensions.css" GridPane.columnIndex="4" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" GridPane.vgrow="ALWAYS" />
107+
<AnchorPane fx:id="dayScheduleSix" minHeight="550.0" styleClass="odd-timetable-row" stylesheets="@Extensions.css" GridPane.columnIndex="5" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" GridPane.vgrow="ALWAYS" />
108+
<AnchorPane fx:id="dayScheduleSeven" minHeight="550.0" styleClass="even-timetable-row" stylesheets="@Extensions.css" GridPane.columnIndex="6" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" GridPane.vgrow="ALWAYS" />
109109
</children>
110110
</GridPane>
111111
</content>

0 commit comments

Comments
 (0)