Skip to content

Commit

Permalink
Merge pull request #238 from zengzihui/add-credit
Browse files Browse the repository at this point in the history
Add credits for the parts that I reused code from some inspiration
  • Loading branch information
felixchanyy authored Apr 14, 2024
2 parents 25824f2 + b95f262 commit 1fa7473
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/seedu/address/model/ModelManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ public State getState() {
}

public void setState(State newState) {
// Solution below inspired by
// https://github.com/AY2324S1-CS2103T-T11-3/tp/blob/master/src/main/java/seedu/address/model/ModelManager.java
boolean isStateChanged = isSameState(newState);
if (!isStateChanged) {
state = newState;
Expand All @@ -195,6 +197,9 @@ public boolean isSameState(State newState) {
public void setUi(Ui ui) {
this.ui = ui;
}

// Solution below inspired by
// https://github.com/AY2324S1-CS2103T-T11-3/tp/blob/master/src/main/java/seedu/address/model/ModelManager.java
@Override
public void showPerson(Person target) {
requireNonNull(target);
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/seedu/address/ui/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ private void handleExit() {
* Handles view a specific person request
*/
public void handleViewPerson(Person person) {
// Solution below inspired by
// https://github.com/AY2324S1-CS2103T-T11-3/tp/blob/master/src/main/java/seedu/address/ui/MainWindow.java
if (person == null) {
personDetails.setVisible(false);
return;
Expand All @@ -208,6 +210,8 @@ public void handleViewPerson(Person person) {
* Handles displaying match results from the matchBuyer command.
*/
public void handleDisplayMatchResults(ObservableList<Seller> sellers) {
// Solution below inspired by
// https://github.com/AY2324S1-CS2103T-T11-3/tp/blob/master/src/main/java/seedu/address/ui/MainWindow.java
if (sellers == null) {
matchResultList.setVisible(false);
}
Expand Down Expand Up @@ -250,6 +254,8 @@ private CommandResult executeCommand(String commandText) throws CommandException
* Updates the ui layout for displaying.
*/
public void updateUiLayout(State newState) {
// Solution below inspired by
// https://github.com/AY2324S1-CS2103T-T11-3/tp/blob/master/src/main/java/seedu/address/ui/MainWindow.java
contentBoxSplitPane.getItems().removeAll(personList, personDetails, matchResultList);
switch (newState) {
case PERSON_LIST:
Expand Down

0 comments on commit 1fa7473

Please sign in to comment.