forked from nus-cs2103-AY2122S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from random689/Update_1.2b
Update GUI, UserGuide and bugfix
- Loading branch information
Showing
20 changed files
with
233 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,8 @@ NewAddressBook is a **desktop app built for secondary school teachers** handling | |
|
||
* **`list`** : Lists all contacts. | ||
|
||
* **`student`**`student n/John Doe p/94629424 e/[email protected] a/George street, block 123, #01-01 f/3A2 g/M i/Math class em/92696977 m/Asthma` : Adds a student named `John Doe` to NewAddressBook. | ||
* **`student`**` | ||
student n/John Doe p/98765432 e/[email protected] g/M a/311, Clementi Ave 2, #02-25 f/3E1 em/999 i/Math class t/naughty ` : Adds a student named `John Doe` to NewAddressBook. | ||
|
||
* **`delete`**`3` : Deletes the 3rd contact shown in the current list. | ||
|
||
|
@@ -116,9 +117,8 @@ A teacher can have any number of tags (including 0), such as whether he/she is a | |
</div> | ||
|
||
Examples: | ||
* `teacher n/Gabe p/91234567 e/[email protected] i/Lunch buddy` | ||
* `teacher n/Lebron p/91234567 e/[email protected] a/George street, block 123, #01-01 i/Math HOD | ||
t/relief` | ||
* `teacher n/Gabe p/91234567 e/[email protected] g/M o/151 i/Lunch buddy` | ||
* `teacher n/Lebron p/91234567 e/[email protected] g/F o/12 i/Math HOD t/relief` | ||
|
||
### Adding a medical history to a student: `medical` | ||
|
||
|
@@ -285,9 +285,10 @@ _Details coming soon ..._ | |
Action | Format, Examples | ||
--------|------------------ | ||
**Student** | `student n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS f/FORM_CLASS g/GENDER i/INVOLVEMENT em/EMERGENCY_NUMBER [m/MEDICAL_HISTORY]… [t/TAG]…` <br> e.g., `student n/James p/94629424 e/[email protected] a/George street, block 123, #01-01 f/3A2 g/M i/Math class em/92696977 m/asthma t/representative` | ||
**Teacher** | `teacher n/Name p/PHONE_NUMBER e/EMAIL g/GENDER o/OFFICE_TABLE_NUMBER i/INVOLVEMENT [t/TAG]…` <br> e.g., `teacher n/Gabe p/91234567 e/[email protected] g/M o/151 i/Lunch buddy` | ||
**Clear** | `clear` | ||
**Delete** | `delete INDEX`<br> e.g., `delete 3` | ||
**Edit** | `edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [t/TAG]…`<br> e.g.,`edit 2 n/James Lee e/[email protected]` | ||
**Edit** | `edit<Teacher/Student> INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [t/TAG]…`<br> e.g.,`editStudent 2 n/James Lee e/[email protected]` | ||
**Find** | `find KEYWORD [MORE_KEYWORDS]`<br> e.g., `find James Jake` | ||
**Copy** | `copy f/FIELD` <br> e.g., `copy f/email` | ||
**List** | `list` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ public class AddStudentCommand extends Command { | |
+ PREFIX_EMAIL + "[email protected] " | ||
+ PREFIX_GENDER + "M " | ||
+ PREFIX_ADDRESS + "311, Clementi Ave 2, #02-25 " | ||
+ PREFIX_FORM_CLASS + "3E1" | ||
+ PREFIX_FORM_CLASS + "3E1 " | ||
+ PREFIX_EMERGENCY_CONTACT + "999 " | ||
+ PREFIX_INVOLVEMENT + "Math class " | ||
+ PREFIX_TAG + "naughty "; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ public class AddTeacherCommand extends Command { | |
+ PREFIX_PHONE + "98765432 " | ||
+ PREFIX_EMAIL + "[email protected] " | ||
+ PREFIX_GENDER + "M " | ||
+ PREFIX_OFFICE_TABLE + "7" | ||
+ PREFIX_OFFICE_TABLE + "7 " | ||
+ PREFIX_INVOLVEMENT + "Math HOD " | ||
+ PREFIX_TAG + "Colleague"; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
package seedu.address.ui; | ||
|
||
import java.util.Comparator; | ||
|
||
import javafx.fxml.FXML; | ||
import javafx.scene.control.Label; | ||
import javafx.scene.layout.FlowPane; | ||
import javafx.scene.layout.HBox; | ||
import javafx.scene.layout.Region; | ||
import seedu.address.model.person.Teacher; | ||
|
||
/** | ||
* An UI component that displays information of a {@code Teacher}. | ||
*/ | ||
public class TeacherCard extends UiPart<Region> { | ||
|
||
private static final String FXML = "TeacherListCard.fxml"; | ||
|
||
/** | ||
* Note: Certain keywords such as "location" and "resources" are reserved keywords in JavaFX. | ||
* As a consequence, UI elements' variable names cannot be set to such keywords | ||
* or an exception will be thrown by JavaFX during runtime. | ||
* | ||
* @see <a href="https://github.com/se-edu/addressbook-level4/issues/336">The issue on AddressBook level 4</a> | ||
*/ | ||
|
||
public final Teacher teacher; | ||
|
||
@FXML | ||
private HBox cardPane; | ||
@FXML | ||
private Label name; | ||
@FXML | ||
private Label id; | ||
@FXML | ||
private Label phone; | ||
@FXML | ||
private Label email; | ||
@FXML | ||
private Label gender; | ||
@FXML | ||
private Label involvement; | ||
@FXML | ||
private Label officeTable; | ||
@FXML | ||
private FlowPane tags; | ||
|
||
/** | ||
* Creates a {@code TeacherCode} with the given {@code Teacher} and index to display. | ||
*/ | ||
public TeacherCard(Teacher teacher, int displayedIndex) { | ||
super(FXML); | ||
this.teacher = teacher; | ||
id.setText(displayedIndex + ". "); | ||
name.setText(teacher.getName().fullName); | ||
phone.setText(teacher.getPhone().value); | ||
email.setText(teacher.getEmail().value); | ||
gender.setText(teacher.getGender().value); | ||
officeTable.setText(teacher.getOfficeTable().value); | ||
involvement.setText(teacher.getInvolvement().value); | ||
teacher.getTags().stream() | ||
.sorted(Comparator.comparing(tag -> tag.tagName)) | ||
.forEach(tag -> tags.getChildren().add(new Label(tag.tagName))); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object other) { | ||
// short circuit if same object | ||
if (other == this) { | ||
return true; | ||
} | ||
|
||
// instanceof handles nulls | ||
if (!(other instanceof TeacherCard)) { | ||
return false; | ||
} | ||
|
||
// state check | ||
TeacherCard card = (TeacherCard) other; | ||
return id.getText().equals(card.id.getText()) | ||
&& teacher.equals(card.teacher); | ||
} | ||
} |
Oops, something went wrong.