From 7d815632f812b0d9401d76e8d83663a34666f2b7 Mon Sep 17 00:00:00 2001 From: joszx Date: Mon, 28 Mar 2022 03:33:49 +0800 Subject: [PATCH 1/5] Add Summary Bar and one summary box for total applications --- src/main/java/seedu/address/logic/Logic.java | 4 + .../seedu/address/logic/LogicManager.java | 6 ++ .../address/model/InternApplyMemory.java | 16 +++ src/main/java/seedu/address/model/Model.java | 5 + .../seedu/address/model/ModelManager.java | 28 +++++ .../application/UniqueApplicationList.java | 7 ++ .../address/model/summarybar/SummaryBar.java | 4 + .../address/model/summarybar/SummaryBox.java | 58 ++++++++++ .../address/model/summarybar/SummaryList.java | 28 +++++ .../java/seedu/address/ui/MainWindow.java | 7 ++ .../java/seedu/address/ui/SummaryCard.java | 63 +++++++++++ .../seedu/address/ui/SummaryListPanel.java | 49 +++++++++ .../resources/view/ApplicationListPanel.fxml | 2 +- src/main/resources/view/MainWindow.fxml | 102 ++++++++++-------- src/main/resources/view/SummaryListCard.fxml | 46 ++++++++ src/main/resources/view/SummaryListPanel.fxml | 8 ++ 16 files changed, 389 insertions(+), 44 deletions(-) create mode 100644 src/main/java/seedu/address/model/summarybar/SummaryBar.java create mode 100644 src/main/java/seedu/address/model/summarybar/SummaryBox.java create mode 100644 src/main/java/seedu/address/model/summarybar/SummaryList.java create mode 100644 src/main/java/seedu/address/ui/SummaryCard.java create mode 100644 src/main/java/seedu/address/ui/SummaryListPanel.java create mode 100644 src/main/resources/view/SummaryListCard.fxml create mode 100644 src/main/resources/view/SummaryListPanel.fxml diff --git a/src/main/java/seedu/address/logic/Logic.java b/src/main/java/seedu/address/logic/Logic.java index 1f2f89d6cd0..9fd40dda60e 100644 --- a/src/main/java/seedu/address/logic/Logic.java +++ b/src/main/java/seedu/address/logic/Logic.java @@ -9,6 +9,7 @@ import seedu.address.logic.parser.exceptions.ParseException; import seedu.address.model.ReadOnlyInternApplyMemory; import seedu.address.model.application.Application; +import seedu.address.model.summarybar.SummaryBox; /** * API of the Logic component @@ -33,6 +34,9 @@ public interface Logic { /** Returns an unmodifiable view of the filtered list of applications */ ObservableList getFilteredApplicationsList(); + /** Returns an unmodifiable view of the list of summary boxes */ + ObservableList getSummaryBoxList(); + /** * Returns the user prefs' intern apply file path. */ diff --git a/src/main/java/seedu/address/logic/LogicManager.java b/src/main/java/seedu/address/logic/LogicManager.java index a2c95d74dd6..bfaa38ca089 100644 --- a/src/main/java/seedu/address/logic/LogicManager.java +++ b/src/main/java/seedu/address/logic/LogicManager.java @@ -15,6 +15,7 @@ import seedu.address.model.Model; import seedu.address.model.ReadOnlyInternApplyMemory; import seedu.address.model.application.Application; +import seedu.address.model.summarybar.SummaryBox; import seedu.address.storage.Storage; /** @@ -64,6 +65,11 @@ public ObservableList getFilteredApplicationsList() { return model.getFilteredApplicationList(); } + @Override + public ObservableList getSummaryBoxList() { + return model.getSummaryBoxList(); + } + @Override public Path getInternApplyFilePath() { return model.getInternApplyMemoryFilePath(); diff --git a/src/main/java/seedu/address/model/InternApplyMemory.java b/src/main/java/seedu/address/model/InternApplyMemory.java index 5be05041cf0..a484b1e07f5 100644 --- a/src/main/java/seedu/address/model/InternApplyMemory.java +++ b/src/main/java/seedu/address/model/InternApplyMemory.java @@ -2,11 +2,15 @@ import static java.util.Objects.requireNonNull; +import java.lang.reflect.Array; +import java.util.ArrayList; +import java.util.Iterator; import java.util.List; import javafx.collections.ObservableList; import seedu.address.model.application.Application; import seedu.address.model.application.UniqueApplicationList; +import seedu.address.model.summarybar.SummaryBox; /** * Wraps all data at the memory level @@ -15,6 +19,7 @@ public class InternApplyMemory implements ReadOnlyInternApplyMemory { private final UniqueApplicationList applications; + private ArrayList summaryBoxes; /* * The 'unusual' code block below is a non-static initialization block, sometimes used to avoid duplication @@ -25,6 +30,7 @@ public class InternApplyMemory implements ReadOnlyInternApplyMemory { */ { applications = new UniqueApplicationList(); + summaryBoxes = new ArrayList<>(); } public InternApplyMemory() {} @@ -35,6 +41,7 @@ public InternApplyMemory() {} public InternApplyMemory(ReadOnlyInternApplyMemory toBeCopied) { this(); resetData(toBeCopied); + initSummaryBoxes(); } //// list overwrite operations @@ -107,6 +114,15 @@ public ObservableList getApplicationList() { return applications.asUnmodifiableObservableList(); } + private void initSummaryBoxes() { + summaryBoxes.add(new SummaryBox("Total Applications", 0, applications.getSize())); + + } + + public ArrayList getSummaryBoxes() { + return summaryBoxes; + } + @Override public boolean equals(Object other) { return other == this // short circuit if same object diff --git a/src/main/java/seedu/address/model/Model.java b/src/main/java/seedu/address/model/Model.java index 78c884e225b..f29596d0417 100644 --- a/src/main/java/seedu/address/model/Model.java +++ b/src/main/java/seedu/address/model/Model.java @@ -6,6 +6,7 @@ import javafx.collections.ObservableList; import seedu.address.commons.core.GuiSettings; import seedu.address.model.application.Application; +import seedu.address.model.summarybar.SummaryBox; /** * The API of the Model component. @@ -85,4 +86,8 @@ public interface Model { * @throws NullPointerException if {@code predicate} is null. */ void updateFilteredApplicationList(Predicate predicate); + + ObservableList getSummaryBoxList(); + + void updateSummaryBoxList(); } diff --git a/src/main/java/seedu/address/model/ModelManager.java b/src/main/java/seedu/address/model/ModelManager.java index 75c59a0d912..be0f84607af 100644 --- a/src/main/java/seedu/address/model/ModelManager.java +++ b/src/main/java/seedu/address/model/ModelManager.java @@ -7,11 +7,14 @@ import java.util.function.Predicate; import java.util.logging.Logger; +import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.collections.transformation.FilteredList; import seedu.address.commons.core.GuiSettings; import seedu.address.commons.core.LogsCenter; import seedu.address.model.application.Application; +import seedu.address.model.summarybar.SummaryBox; +import seedu.address.model.summarybar.SummaryList; /** * Represents the in-memory model of InternApply data. @@ -22,6 +25,8 @@ public class ModelManager implements Model { private final InternApplyMemory internApplyMemory; private final UserPrefs userPrefs; private final FilteredList filteredApplications; + private final SummaryList summaryList; + private final ObservableList applications; /** * Initializes a ModelManager with the given internApplyMemory and userPrefs. @@ -35,6 +40,8 @@ public ModelManager(ReadOnlyInternApplyMemory internApplyMemory, ReadOnlyUserPre this.internApplyMemory = new InternApplyMemory(internApplyMemory); this.userPrefs = new UserPrefs(userPrefs); filteredApplications = new FilteredList<>(this.internApplyMemory.getApplicationList()); + summaryList = new SummaryList(this.internApplyMemory.getSummaryBoxes()); + applications = FXCollections.observableList(this.internApplyMemory.getApplicationList()); } public ModelManager() { @@ -129,6 +136,27 @@ public void updateFilteredApplicationList(Predicate predicate) { filteredApplications.setPredicate(predicate); } + //========== Summary Box List Accessors =============================================================== + + @Override + public ObservableList getSummaryBoxList() { + return summaryList.getObservableList(); + } + + @Override + public void updateSummaryBoxList() { + summaryList.update(getTotalApplications()); + } + + private int getTotalApplications() { + int count = 0; + for (Application application : applications) { + count++; + } + return count; + } + + @Override public boolean equals(Object obj) { // short circuit if same object diff --git a/src/main/java/seedu/address/model/application/UniqueApplicationList.java b/src/main/java/seedu/address/model/application/UniqueApplicationList.java index 2ffc4c83fdd..9d48f61bd2e 100644 --- a/src/main/java/seedu/address/model/application/UniqueApplicationList.java +++ b/src/main/java/seedu/address/model/application/UniqueApplicationList.java @@ -106,6 +106,13 @@ public ObservableList asUnmodifiableObservableList() { return internalUnmodifiableList; } + /** + * Returns the size of the list. + */ + public int getSize() { + return internalList.size(); + } + @Override public Iterator iterator() { return internalList.iterator(); diff --git a/src/main/java/seedu/address/model/summarybar/SummaryBar.java b/src/main/java/seedu/address/model/summarybar/SummaryBar.java new file mode 100644 index 00000000000..50b8b8936ab --- /dev/null +++ b/src/main/java/seedu/address/model/summarybar/SummaryBar.java @@ -0,0 +1,4 @@ +package seedu.address.model.summarybar; + +public class SummaryBar { +} diff --git a/src/main/java/seedu/address/model/summarybar/SummaryBox.java b/src/main/java/seedu/address/model/summarybar/SummaryBox.java new file mode 100644 index 00000000000..104550bdec7 --- /dev/null +++ b/src/main/java/seedu/address/model/summarybar/SummaryBox.java @@ -0,0 +1,58 @@ +package seedu.address.model.summarybar; + +import java.util.Objects; + +public class SummaryBox { + + private String name; + private int currApplications; + private int totalApplications; + + + public SummaryBox(String name, int numApplications, int totalApplications) { + this.name = name; + this.currApplications = numApplications; + this.totalApplications = totalApplications; + } + + public String getName() { + return name; + } + + public int getCurrApplications() { + return currApplications; + } + + public int getTotalApplications() { + return totalApplications; + } + + public void setCurrApplications(int currApplications) { + this.currApplications = currApplications; + } + + public void setTotalApplications(int totalApplications) { + this.totalApplications = totalApplications; + } + + public void update(int currApplications, int totalApplications) { + this.currApplications = currApplications; + this.totalApplications = totalApplications; + } + + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + SummaryBox that = (SummaryBox) o; + return currApplications == that.currApplications + && totalApplications == that.totalApplications + && Objects.equals(name, that.name); + } + + @Override + public int hashCode() { + return Objects.hash(name, currApplications, totalApplications); + } +} diff --git a/src/main/java/seedu/address/model/summarybar/SummaryList.java b/src/main/java/seedu/address/model/summarybar/SummaryList.java new file mode 100644 index 00000000000..0d43aff6159 --- /dev/null +++ b/src/main/java/seedu/address/model/summarybar/SummaryList.java @@ -0,0 +1,28 @@ +package seedu.address.model.summarybar; + +import java.util.ArrayList; + +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; + +public class SummaryList { + + private ObservableList summaryList; + + public SummaryList(ArrayList summaryBoxes) { + summaryList = FXCollections.observableArrayList(summaryBoxes); + } + + public ObservableList getObservableList() { + return summaryList; + } + + public void update(int totalApplications) { + // TODO: update all the individual summary boxes by setting their relevant fields + + } + + private void updateTotalApplications(int totalApplications) { + + } +} diff --git a/src/main/java/seedu/address/ui/MainWindow.java b/src/main/java/seedu/address/ui/MainWindow.java index 09f5e9a7711..2e7797c4d8d 100644 --- a/src/main/java/seedu/address/ui/MainWindow.java +++ b/src/main/java/seedu/address/ui/MainWindow.java @@ -34,6 +34,7 @@ public class MainWindow extends UiPart { private ApplicationListPanel applicationListPanel; private ResultDisplay resultDisplay; private HelpWindow helpWindow; + private SummaryListPanel summaryListPanel; @FXML private StackPane commandBoxPlaceholder; @@ -50,6 +51,9 @@ public class MainWindow extends UiPart { @FXML private StackPane statusbarPlaceholder; + @FXML + private StackPane summaryListPanelPlaceholder; + /** * Creates a {@code MainWindow} with the given {@code Stage} and {@code Logic}. */ @@ -121,6 +125,9 @@ void fillInnerParts() { CommandBox commandBox = new CommandBox(this::executeCommand); commandBoxPlaceholder.getChildren().add(commandBox.getRoot()); + + summaryListPanel = new SummaryListPanel(logic.getSummaryBoxList()); + summaryListPanelPlaceholder.getChildren().add(summaryListPanel.getRoot()); } /** diff --git a/src/main/java/seedu/address/ui/SummaryCard.java b/src/main/java/seedu/address/ui/SummaryCard.java new file mode 100644 index 00000000000..dbd6023e955 --- /dev/null +++ b/src/main/java/seedu/address/ui/SummaryCard.java @@ -0,0 +1,63 @@ +package seedu.address.ui; + +import javafx.fxml.FXML; +import javafx.scene.control.Label; +import javafx.scene.layout.HBox; +import javafx.scene.layout.Region; +import seedu.address.model.summarybar.SummaryBox; + +/** + * An UI component that displays information of an {@code Application}. + */ +public class SummaryCard extends UiPart { + + private static final String FXML = "SummaryListCard.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 The issue on AddressBook level 4 + */ + + public final SummaryBox summaryBox; + + @FXML + private HBox cardPane; + @FXML + private Label name; + @FXML + private Label currApplications; + @FXML + private Label totalApplications; + + /** + * Creates an {@code ApplicationCard} with the given {@code Application} and index to display. + */ + public SummaryCard(SummaryBox summaryBox) { + super(FXML); + this.summaryBox = summaryBox; + name.setText(summaryBox.getName()); + currApplications.setText(String.valueOf(summaryBox.getCurrApplications())); + totalApplications.setText(String.valueOf(summaryBox.getTotalApplications())); + } + + @Override + public boolean equals(Object other) { + // short circuit if same object + if (other == this) { + return true; + } + + // instanceof handles nulls + if (!(other instanceof SummaryCard)) { + return false; + } + + // state check + SummaryCard card = (SummaryCard) other; + return name.getText().equals(card.name.getText()) + && summaryBox.equals(card.summaryBox); + } +} diff --git a/src/main/java/seedu/address/ui/SummaryListPanel.java b/src/main/java/seedu/address/ui/SummaryListPanel.java new file mode 100644 index 00000000000..45684505b37 --- /dev/null +++ b/src/main/java/seedu/address/ui/SummaryListPanel.java @@ -0,0 +1,49 @@ +package seedu.address.ui; + +import java.util.logging.Logger; + +import javafx.collections.ObservableList; +import javafx.fxml.FXML; +import javafx.scene.control.ListCell; +import javafx.scene.control.ListView; +import javafx.scene.layout.Region; +import seedu.address.commons.core.LogsCenter; +import seedu.address.model.summarybar.SummaryBox; + +/** + * Panel containing the list of application summaries. + */ +public class SummaryListPanel extends UiPart { + private static final String FXML = "SummaryListPanel.fxml"; + private final Logger logger = LogsCenter.getLogger(SummaryListPanel.class); + + @FXML + private ListView summaryListView; + + /** + * Creates a {@code SummaryListPanel} with the given {@code ObservableList}. + */ + public SummaryListPanel(ObservableList summaryList) { + super(FXML); + summaryListView.setItems(summaryList); + summaryListView.setCellFactory(listView -> new SummaryListViewCell()); + } + + /** + * Custom {@code ListCell} that displays the graphics of a {@code summaryBox} using a {@code SummaryCard}. + */ + class SummaryListViewCell extends ListCell { + @Override + protected void updateItem(SummaryBox summaryBox, boolean empty) { + super.updateItem(summaryBox, empty); + + if (empty || summaryBox == null) { + setGraphic(null); + setText(null); + } else { + setGraphic(new SummaryCard(summaryBox).getRoot()); + } + } + } + +} diff --git a/src/main/resources/view/ApplicationListPanel.fxml b/src/main/resources/view/ApplicationListPanel.fxml index 277afdacdea..67d0eb8b5a9 100644 --- a/src/main/resources/view/ApplicationListPanel.fxml +++ b/src/main/resources/view/ApplicationListPanel.fxml @@ -3,6 +3,6 @@ - + diff --git a/src/main/resources/view/MainWindow.fxml b/src/main/resources/view/MainWindow.fxml index dc2ad87a71b..1876f9c750d 100644 --- a/src/main/resources/view/MainWindow.fxml +++ b/src/main/resources/view/MainWindow.fxml @@ -6,55 +6,71 @@ - + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + diff --git a/src/main/resources/view/SummaryListCard.fxml b/src/main/resources/view/SummaryListCard.fxml new file mode 100644 index 00000000000..ee367c57583 --- /dev/null +++ b/src/main/resources/view/SummaryListCard.fxml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/view/SummaryListPanel.fxml b/src/main/resources/view/SummaryListPanel.fxml new file mode 100644 index 00000000000..208205cdf54 --- /dev/null +++ b/src/main/resources/view/SummaryListPanel.fxml @@ -0,0 +1,8 @@ + + + + + + + + From 6938d36e2566bb00c176c36080404f94dd9a888f Mon Sep 17 00:00:00 2001 From: joszx Date: Tue, 29 Mar 2022 02:58:17 +0800 Subject: [PATCH 2/5] Add summary box classes and UI Summary boxes added : Total applications High, Medium and Low priority tags Applied and Not Applied tags --- .../address/model/InternApplyMemory.java | 12 ---- .../seedu/address/model/ModelManager.java | 14 +--- .../address/model/summarybar/SummaryBox.java | 27 +++----- .../address/model/summarybar/SummaryList.java | 66 +++++++++++++++++-- .../model/summarybar/TagSummaryBox.java | 41 ++++++++++++ .../summarybar/TotalApplicationsBox.java | 21 ++++++ .../java/seedu/address/ui/SummaryCard.java | 8 ++- 7 files changed, 139 insertions(+), 50 deletions(-) create mode 100644 src/main/java/seedu/address/model/summarybar/TagSummaryBox.java create mode 100644 src/main/java/seedu/address/model/summarybar/TotalApplicationsBox.java diff --git a/src/main/java/seedu/address/model/InternApplyMemory.java b/src/main/java/seedu/address/model/InternApplyMemory.java index a484b1e07f5..348b9439448 100644 --- a/src/main/java/seedu/address/model/InternApplyMemory.java +++ b/src/main/java/seedu/address/model/InternApplyMemory.java @@ -19,7 +19,6 @@ public class InternApplyMemory implements ReadOnlyInternApplyMemory { private final UniqueApplicationList applications; - private ArrayList summaryBoxes; /* * The 'unusual' code block below is a non-static initialization block, sometimes used to avoid duplication @@ -30,7 +29,6 @@ public class InternApplyMemory implements ReadOnlyInternApplyMemory { */ { applications = new UniqueApplicationList(); - summaryBoxes = new ArrayList<>(); } public InternApplyMemory() {} @@ -41,7 +39,6 @@ public InternApplyMemory() {} public InternApplyMemory(ReadOnlyInternApplyMemory toBeCopied) { this(); resetData(toBeCopied); - initSummaryBoxes(); } //// list overwrite operations @@ -114,15 +111,6 @@ public ObservableList getApplicationList() { return applications.asUnmodifiableObservableList(); } - private void initSummaryBoxes() { - summaryBoxes.add(new SummaryBox("Total Applications", 0, applications.getSize())); - - } - - public ArrayList getSummaryBoxes() { - return summaryBoxes; - } - @Override public boolean equals(Object other) { return other == this // short circuit if same object diff --git a/src/main/java/seedu/address/model/ModelManager.java b/src/main/java/seedu/address/model/ModelManager.java index be0f84607af..a41b8d14322 100644 --- a/src/main/java/seedu/address/model/ModelManager.java +++ b/src/main/java/seedu/address/model/ModelManager.java @@ -4,6 +4,7 @@ import static seedu.address.commons.util.CollectionUtil.requireAllNonNull; import java.nio.file.Path; +import java.util.ArrayList; import java.util.function.Predicate; import java.util.logging.Logger; @@ -40,8 +41,8 @@ public ModelManager(ReadOnlyInternApplyMemory internApplyMemory, ReadOnlyUserPre this.internApplyMemory = new InternApplyMemory(internApplyMemory); this.userPrefs = new UserPrefs(userPrefs); filteredApplications = new FilteredList<>(this.internApplyMemory.getApplicationList()); - summaryList = new SummaryList(this.internApplyMemory.getSummaryBoxes()); applications = FXCollections.observableList(this.internApplyMemory.getApplicationList()); + summaryList = new SummaryList(applications); } public ModelManager() { @@ -145,18 +146,9 @@ public ObservableList getSummaryBoxList() { @Override public void updateSummaryBoxList() { - summaryList.update(getTotalApplications()); + summaryList.update(applications); } - private int getTotalApplications() { - int count = 0; - for (Application application : applications) { - count++; - } - return count; - } - - @Override public boolean equals(Object obj) { // short circuit if same object diff --git a/src/main/java/seedu/address/model/summarybar/SummaryBox.java b/src/main/java/seedu/address/model/summarybar/SummaryBox.java index 104550bdec7..351fdcc2c9b 100644 --- a/src/main/java/seedu/address/model/summarybar/SummaryBox.java +++ b/src/main/java/seedu/address/model/summarybar/SummaryBox.java @@ -1,17 +1,16 @@ package seedu.address.model.summarybar; import java.util.Objects; +import java.util.Optional; -public class SummaryBox { +public abstract class SummaryBox { private String name; - private int currApplications; private int totalApplications; - public SummaryBox(String name, int numApplications, int totalApplications) { + public SummaryBox(String name, int totalApplications) { this.name = name; - this.currApplications = numApplications; this.totalApplications = totalApplications; } @@ -19,26 +18,17 @@ public String getName() { return name; } - public int getCurrApplications() { - return currApplications; - } - public int getTotalApplications() { return totalApplications; } - public void setCurrApplications(int currApplications) { - this.currApplications = currApplications; - } - public void setTotalApplications(int totalApplications) { this.totalApplications = totalApplications; } - public void update(int currApplications, int totalApplications) { - this.currApplications = currApplications; - this.totalApplications = totalApplications; - } + public abstract Optional getCurrApplications(); + + public abstract void update(int[] summaryInfo); @Override @@ -46,13 +36,12 @@ public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SummaryBox that = (SummaryBox) o; - return currApplications == that.currApplications - && totalApplications == that.totalApplications + return totalApplications == that.totalApplications && Objects.equals(name, that.name); } @Override public int hashCode() { - return Objects.hash(name, currApplications, totalApplications); + return Objects.hash(name, totalApplications); } } diff --git a/src/main/java/seedu/address/model/summarybar/SummaryList.java b/src/main/java/seedu/address/model/summarybar/SummaryList.java index 0d43aff6159..d13a9a64454 100644 --- a/src/main/java/seedu/address/model/summarybar/SummaryList.java +++ b/src/main/java/seedu/address/model/summarybar/SummaryList.java @@ -1,28 +1,80 @@ package seedu.address.model.summarybar; -import java.util.ArrayList; +import java.util.Set; import javafx.collections.FXCollections; import javafx.collections.ObservableList; +import seedu.address.model.application.Application; +import seedu.address.model.tag.Tag; public class SummaryList { + private static final int SUMMARY_INFO_SIZE = 6; + + public static final int TOTAL_APPLICATIONS_INDEX = 0; + public static final int TOTAL_HIGH_PRIORITY_APPLICATIONS_INDEX = 1; + public static final int TOTAL_MEDIUM_PRIORITY_APPLICATIONS_INDEX = 2; + public static final int TOTAL_LOW_PRIORITY_APPLICATIONS_INDEX = 3; + public static final int TOTAL_APPLIED_APPLICATIONS_INDEX = 4; + public static final int TOTAL_NOT_APPLIED_APPLICATIONS_INDEX = 5; + + private static final String HIGH_PRIORITY_TAG = "HIGH"; + private static final String MEDIUM_PRIORITY_TAG = "MEDIUM"; + private static final String LOW_PRIORITY_TAG = "LOW"; + private static final String APPLIED_STATUS_TAG = "APPLIED"; + private static final String NOT_APPLIED_STATUS_TAG = "NOT_APPLIED"; + private ObservableList summaryList; + private ObservableList applications; - public SummaryList(ArrayList summaryBoxes) { - summaryList = FXCollections.observableArrayList(summaryBoxes); + public SummaryList(ObservableList applications) { + this.applications = applications; + summaryList = FXCollections.observableArrayList(); + int totalApplications = getTotalApplications(); + + summaryList.add(new TotalApplicationsBox("Total", totalApplications)); + summaryList.add(new TagSummaryBox("High Priority", getTotalTagApplications(HIGH_PRIORITY_TAG), + totalApplications, TOTAL_HIGH_PRIORITY_APPLICATIONS_INDEX)); + summaryList.add(new TagSummaryBox("Medium Priority", getTotalTagApplications(MEDIUM_PRIORITY_TAG), + totalApplications, TOTAL_MEDIUM_PRIORITY_APPLICATIONS_INDEX)); + summaryList.add(new TagSummaryBox("Low Priority", getTotalTagApplications(LOW_PRIORITY_TAG), + totalApplications, TOTAL_LOW_PRIORITY_APPLICATIONS_INDEX)); + summaryList.add(new TagSummaryBox("Applied", getTotalTagApplications(APPLIED_STATUS_TAG), + totalApplications, TOTAL_APPLIED_APPLICATIONS_INDEX)); + summaryList.add(new TagSummaryBox("Not Applied", getTotalTagApplications(NOT_APPLIED_STATUS_TAG), + totalApplications, TOTAL_NOT_APPLIED_APPLICATIONS_INDEX)); } public ObservableList getObservableList() { return summaryList; } - public void update(int totalApplications) { - // TODO: update all the individual summary boxes by setting their relevant fields - + public void update(ObservableList applications) { + this.applications = applications; + int[] summaryInfo = new int[SUMMARY_INFO_SIZE]; + summaryInfo[TOTAL_APPLICATIONS_INDEX] = getTotalApplications(); + summaryInfo[TOTAL_HIGH_PRIORITY_APPLICATIONS_INDEX] = getTotalTagApplications(HIGH_PRIORITY_TAG); + summaryInfo[TOTAL_MEDIUM_PRIORITY_APPLICATIONS_INDEX] = getTotalTagApplications(MEDIUM_PRIORITY_TAG); + summaryInfo[TOTAL_LOW_PRIORITY_APPLICATIONS_INDEX] = getTotalTagApplications(LOW_PRIORITY_TAG); + summaryInfo[TOTAL_APPLIED_APPLICATIONS_INDEX] = getTotalTagApplications(APPLIED_STATUS_TAG); + summaryInfo[TOTAL_NOT_APPLIED_APPLICATIONS_INDEX] = getTotalTagApplications(NOT_APPLIED_STATUS_TAG); + for (SummaryBox summaryBox : summaryList) { + summaryBox.update(summaryInfo); + } } - private void updateTotalApplications(int totalApplications) { + private int getTotalApplications() { + return applications.size(); + } + private int getTotalTagApplications(String tagName) { + int count = 0; + Tag toFind = new Tag(tagName); + for (Application application : applications) { + if (application.getTags().contains(toFind)) { + count++; + } + } + return count; } } diff --git a/src/main/java/seedu/address/model/summarybar/TagSummaryBox.java b/src/main/java/seedu/address/model/summarybar/TagSummaryBox.java new file mode 100644 index 00000000000..90613e31e20 --- /dev/null +++ b/src/main/java/seedu/address/model/summarybar/TagSummaryBox.java @@ -0,0 +1,41 @@ +package seedu.address.model.summarybar; + +import java.util.Objects; +import java.util.Optional; + +public class TagSummaryBox extends SummaryBox { + private int id; + private int currApplications; + + TagSummaryBox(String name, int currApplications, int totalApplications, int id) { + super(name, totalApplications); + this.id = id; + this.currApplications = currApplications; + } + + @Override + public Optional getCurrApplications() { + return Optional.of(currApplications); + } + + @Override + public void update(int[] summaryInfo) { + currApplications = summaryInfo[id]; + super.setTotalApplications(summaryInfo[SummaryList.TOTAL_APPLICATIONS_INDEX]); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + if (!super.equals(o)) return false; + TagSummaryBox that = (TagSummaryBox) o; + return id == that.id + && currApplications == that.currApplications; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), id, currApplications); + } +} diff --git a/src/main/java/seedu/address/model/summarybar/TotalApplicationsBox.java b/src/main/java/seedu/address/model/summarybar/TotalApplicationsBox.java new file mode 100644 index 00000000000..f4146d4ce67 --- /dev/null +++ b/src/main/java/seedu/address/model/summarybar/TotalApplicationsBox.java @@ -0,0 +1,21 @@ +package seedu.address.model.summarybar; + +import java.util.Optional; + +public class TotalApplicationsBox extends SummaryBox { + + public TotalApplicationsBox(String name, int totalApplications) { + super(name, totalApplications); + } + + @Override + public Optional getCurrApplications() { + return Optional.empty(); + } + + @Override + public void update(int[] summaryInfo) { + int totalApplications = summaryInfo[SummaryList.TOTAL_APPLICATIONS_INDEX]; + super.setTotalApplications(totalApplications); + } +} diff --git a/src/main/java/seedu/address/ui/SummaryCard.java b/src/main/java/seedu/address/ui/SummaryCard.java index dbd6023e955..c47ecce719f 100644 --- a/src/main/java/seedu/address/ui/SummaryCard.java +++ b/src/main/java/seedu/address/ui/SummaryCard.java @@ -1,5 +1,7 @@ package seedu.address.ui; +import java.util.Optional; + import javafx.fxml.FXML; import javafx.scene.control.Label; import javafx.scene.layout.HBox; @@ -39,7 +41,11 @@ public SummaryCard(SummaryBox summaryBox) { super(FXML); this.summaryBox = summaryBox; name.setText(summaryBox.getName()); - currApplications.setText(String.valueOf(summaryBox.getCurrApplications())); + if (summaryBox.getCurrApplications().isEmpty()) { + currApplications.setText(""); + } else { + currApplications.setText(summaryBox.getCurrApplications().get() + "/"); + } totalApplications.setText(String.valueOf(summaryBox.getTotalApplications())); } From b777b5c04d7a92a600049e4b0f71af18b6e8e448 Mon Sep 17 00:00:00 2001 From: joszx Date: Tue, 29 Mar 2022 20:05:34 +0800 Subject: [PATCH 3/5] Add live update for summary boxes Summary boxes now update live when all commands are executed. --- .../seedu/address/logic/LogicManager.java | 1 + .../seedu/address/model/ModelManager.java | 7 ++-- .../address/model/summarybar/SummaryBox.java | 3 -- .../address/model/summarybar/SummaryList.java | 22 ++++++++---- .../model/summarybar/TagSummaryBox.java | 14 ++------ .../summarybar/TotalApplicationsBox.java | 6 ---- .../java/seedu/address/ui/MainWindow.java | 6 ++-- src/main/resources/view/MainWindow.fxml | 34 ++++++++----------- 8 files changed, 39 insertions(+), 54 deletions(-) diff --git a/src/main/java/seedu/address/logic/LogicManager.java b/src/main/java/seedu/address/logic/LogicManager.java index bfaa38ca089..549fab0dadc 100644 --- a/src/main/java/seedu/address/logic/LogicManager.java +++ b/src/main/java/seedu/address/logic/LogicManager.java @@ -45,6 +45,7 @@ public CommandResult execute(String commandText) throws CommandException, ParseE CommandResult commandResult; Command command = internApplyParser.parseCommand(commandText); commandResult = command.execute(model); + model.updateSummaryBoxList(); try { storage.saveInternApply(model.getInternApplyMemory()); diff --git a/src/main/java/seedu/address/model/ModelManager.java b/src/main/java/seedu/address/model/ModelManager.java index a41b8d14322..135d86c1c12 100644 --- a/src/main/java/seedu/address/model/ModelManager.java +++ b/src/main/java/seedu/address/model/ModelManager.java @@ -4,7 +4,6 @@ import static seedu.address.commons.util.CollectionUtil.requireAllNonNull; import java.nio.file.Path; -import java.util.ArrayList; import java.util.function.Predicate; import java.util.logging.Logger; @@ -27,7 +26,6 @@ public class ModelManager implements Model { private final UserPrefs userPrefs; private final FilteredList filteredApplications; private final SummaryList summaryList; - private final ObservableList applications; /** * Initializes a ModelManager with the given internApplyMemory and userPrefs. @@ -41,8 +39,7 @@ public ModelManager(ReadOnlyInternApplyMemory internApplyMemory, ReadOnlyUserPre this.internApplyMemory = new InternApplyMemory(internApplyMemory); this.userPrefs = new UserPrefs(userPrefs); filteredApplications = new FilteredList<>(this.internApplyMemory.getApplicationList()); - applications = FXCollections.observableList(this.internApplyMemory.getApplicationList()); - summaryList = new SummaryList(applications); + summaryList = new SummaryList(this.internApplyMemory.getApplicationList()); } public ModelManager() { @@ -146,7 +143,7 @@ public ObservableList getSummaryBoxList() { @Override public void updateSummaryBoxList() { - summaryList.update(applications); + summaryList.update(internApplyMemory.getApplicationList()); } @Override diff --git a/src/main/java/seedu/address/model/summarybar/SummaryBox.java b/src/main/java/seedu/address/model/summarybar/SummaryBox.java index 351fdcc2c9b..6f37081112a 100644 --- a/src/main/java/seedu/address/model/summarybar/SummaryBox.java +++ b/src/main/java/seedu/address/model/summarybar/SummaryBox.java @@ -28,9 +28,6 @@ public void setTotalApplications(int totalApplications) { public abstract Optional getCurrApplications(); - public abstract void update(int[] summaryInfo); - - @Override public boolean equals(Object o) { if (this == o) return true; diff --git a/src/main/java/seedu/address/model/summarybar/SummaryList.java b/src/main/java/seedu/address/model/summarybar/SummaryList.java index d13a9a64454..a4994e354d9 100644 --- a/src/main/java/seedu/address/model/summarybar/SummaryList.java +++ b/src/main/java/seedu/address/model/summarybar/SummaryList.java @@ -1,5 +1,6 @@ package seedu.address.model.summarybar; +import java.util.Optional; import java.util.Set; import javafx.collections.FXCollections; @@ -34,15 +35,15 @@ public SummaryList(ObservableList applications) { summaryList.add(new TotalApplicationsBox("Total", totalApplications)); summaryList.add(new TagSummaryBox("High Priority", getTotalTagApplications(HIGH_PRIORITY_TAG), - totalApplications, TOTAL_HIGH_PRIORITY_APPLICATIONS_INDEX)); + totalApplications)); summaryList.add(new TagSummaryBox("Medium Priority", getTotalTagApplications(MEDIUM_PRIORITY_TAG), - totalApplications, TOTAL_MEDIUM_PRIORITY_APPLICATIONS_INDEX)); + totalApplications)); summaryList.add(new TagSummaryBox("Low Priority", getTotalTagApplications(LOW_PRIORITY_TAG), - totalApplications, TOTAL_LOW_PRIORITY_APPLICATIONS_INDEX)); + totalApplications)); summaryList.add(new TagSummaryBox("Applied", getTotalTagApplications(APPLIED_STATUS_TAG), - totalApplications, TOTAL_APPLIED_APPLICATIONS_INDEX)); + totalApplications)); summaryList.add(new TagSummaryBox("Not Applied", getTotalTagApplications(NOT_APPLIED_STATUS_TAG), - totalApplications, TOTAL_NOT_APPLIED_APPLICATIONS_INDEX)); + totalApplications)); } public ObservableList getObservableList() { @@ -58,8 +59,13 @@ public void update(ObservableList applications) { summaryInfo[TOTAL_LOW_PRIORITY_APPLICATIONS_INDEX] = getTotalTagApplications(LOW_PRIORITY_TAG); summaryInfo[TOTAL_APPLIED_APPLICATIONS_INDEX] = getTotalTagApplications(APPLIED_STATUS_TAG); summaryInfo[TOTAL_NOT_APPLIED_APPLICATIONS_INDEX] = getTotalTagApplications(NOT_APPLIED_STATUS_TAG); - for (SummaryBox summaryBox : summaryList) { - summaryBox.update(summaryInfo); + + String totalApplicationsBoxName = summaryList.get(TOTAL_APPLICATIONS_INDEX).getName(); + summaryList.set(0, new TotalApplicationsBox(totalApplicationsBoxName, getTotalApplications())); + + for (int i = 1; i getCurrApplications() { return Optional.of(currApplications); } - @Override - public void update(int[] summaryInfo) { - currApplications = summaryInfo[id]; - super.setTotalApplications(summaryInfo[SummaryList.TOTAL_APPLICATIONS_INDEX]); - } @Override public boolean equals(Object o) { @@ -30,12 +23,11 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; TagSummaryBox that = (TagSummaryBox) o; - return id == that.id - && currApplications == that.currApplications; + return currApplications == that.currApplications; } @Override public int hashCode() { - return Objects.hash(super.hashCode(), id, currApplications); + return Objects.hash(super.hashCode(), currApplications); } } diff --git a/src/main/java/seedu/address/model/summarybar/TotalApplicationsBox.java b/src/main/java/seedu/address/model/summarybar/TotalApplicationsBox.java index f4146d4ce67..ab102f1d744 100644 --- a/src/main/java/seedu/address/model/summarybar/TotalApplicationsBox.java +++ b/src/main/java/seedu/address/model/summarybar/TotalApplicationsBox.java @@ -12,10 +12,4 @@ public TotalApplicationsBox(String name, int totalApplications) { public Optional getCurrApplications() { return Optional.empty(); } - - @Override - public void update(int[] summaryInfo) { - int totalApplications = summaryInfo[SummaryList.TOTAL_APPLICATIONS_INDEX]; - super.setTotalApplications(totalApplications); - } } diff --git a/src/main/java/seedu/address/ui/MainWindow.java b/src/main/java/seedu/address/ui/MainWindow.java index 2e7797c4d8d..89d04070cf3 100644 --- a/src/main/java/seedu/address/ui/MainWindow.java +++ b/src/main/java/seedu/address/ui/MainWindow.java @@ -117,6 +117,9 @@ void fillInnerParts() { applicationListPanel = new ApplicationListPanel(logic.getFilteredApplicationsList()); applicationListPanelPlaceholder.getChildren().add(applicationListPanel.getRoot()); + summaryListPanel = new SummaryListPanel(logic.getSummaryBoxList()); + summaryListPanelPlaceholder.getChildren().add(summaryListPanel.getRoot()); + resultDisplay = new ResultDisplay(); resultDisplayPlaceholder.getChildren().add(resultDisplay.getRoot()); @@ -125,9 +128,6 @@ void fillInnerParts() { CommandBox commandBox = new CommandBox(this::executeCommand); commandBoxPlaceholder.getChildren().add(commandBox.getRoot()); - - summaryListPanel = new SummaryListPanel(logic.getSummaryBoxList()); - summaryListPanelPlaceholder.getChildren().add(summaryListPanel.getRoot()); } /** diff --git a/src/main/resources/view/MainWindow.fxml b/src/main/resources/view/MainWindow.fxml index 1876f9c750d..71aff51491b 100644 --- a/src/main/resources/view/MainWindow.fxml +++ b/src/main/resources/view/MainWindow.fxml @@ -38,32 +38,28 @@ + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + - + From 370df8e809f2ba729405e3feee3a1ab47375f3a5 Mon Sep 17 00:00:00 2001 From: joszx Date: Wed, 30 Mar 2022 00:17:07 +0800 Subject: [PATCH 4/5] Add Javadocs to classes and methods added for summary bar feature. --- src/main/java/seedu/address/logic/Logic.java | 2 +- .../address/model/InternApplyMemory.java | 4 ---- src/main/java/seedu/address/model/Model.java | 2 ++ .../seedu/address/model/ModelManager.java | 3 +-- .../address/model/summarybar/SummaryBar.java | 4 ---- .../address/model/summarybar/SummaryBox.java | 16 +++++++++++++- .../address/model/summarybar/SummaryList.java | 21 +++++++++++++++++++ .../model/summarybar/TagSummaryBox.java | 10 +++++++++ .../summarybar/TotalApplicationsBox.java | 9 ++++++++ .../java/seedu/address/ui/SummaryCard.java | 2 -- 10 files changed, 59 insertions(+), 14 deletions(-) delete mode 100644 src/main/java/seedu/address/model/summarybar/SummaryBar.java diff --git a/src/main/java/seedu/address/logic/Logic.java b/src/main/java/seedu/address/logic/Logic.java index 9fd40dda60e..b227540405d 100644 --- a/src/main/java/seedu/address/logic/Logic.java +++ b/src/main/java/seedu/address/logic/Logic.java @@ -34,7 +34,7 @@ public interface Logic { /** Returns an unmodifiable view of the filtered list of applications */ ObservableList getFilteredApplicationsList(); - /** Returns an unmodifiable view of the list of summary boxes */ + /** Returns a modifiable view of the list of summary boxes */ ObservableList getSummaryBoxList(); /** diff --git a/src/main/java/seedu/address/model/InternApplyMemory.java b/src/main/java/seedu/address/model/InternApplyMemory.java index 348b9439448..5be05041cf0 100644 --- a/src/main/java/seedu/address/model/InternApplyMemory.java +++ b/src/main/java/seedu/address/model/InternApplyMemory.java @@ -2,15 +2,11 @@ import static java.util.Objects.requireNonNull; -import java.lang.reflect.Array; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; import javafx.collections.ObservableList; import seedu.address.model.application.Application; import seedu.address.model.application.UniqueApplicationList; -import seedu.address.model.summarybar.SummaryBox; /** * Wraps all data at the memory level diff --git a/src/main/java/seedu/address/model/Model.java b/src/main/java/seedu/address/model/Model.java index f29596d0417..6bb5a1ac907 100644 --- a/src/main/java/seedu/address/model/Model.java +++ b/src/main/java/seedu/address/model/Model.java @@ -87,7 +87,9 @@ public interface Model { */ void updateFilteredApplicationList(Predicate predicate); + /** Returns a modifiable view of the list of summary boxes */ ObservableList getSummaryBoxList(); + /** Updates the list of summary boxes */ void updateSummaryBoxList(); } diff --git a/src/main/java/seedu/address/model/ModelManager.java b/src/main/java/seedu/address/model/ModelManager.java index 135d86c1c12..3952a164f51 100644 --- a/src/main/java/seedu/address/model/ModelManager.java +++ b/src/main/java/seedu/address/model/ModelManager.java @@ -7,7 +7,6 @@ import java.util.function.Predicate; import java.util.logging.Logger; -import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.collections.transformation.FilteredList; import seedu.address.commons.core.GuiSettings; @@ -134,7 +133,7 @@ public void updateFilteredApplicationList(Predicate predicate) { filteredApplications.setPredicate(predicate); } - //========== Summary Box List Accessors =============================================================== + //============ Summary Box List Accessors =============================================================== @Override public ObservableList getSummaryBoxList() { diff --git a/src/main/java/seedu/address/model/summarybar/SummaryBar.java b/src/main/java/seedu/address/model/summarybar/SummaryBar.java deleted file mode 100644 index 50b8b8936ab..00000000000 --- a/src/main/java/seedu/address/model/summarybar/SummaryBar.java +++ /dev/null @@ -1,4 +0,0 @@ -package seedu.address.model.summarybar; - -public class SummaryBar { -} diff --git a/src/main/java/seedu/address/model/summarybar/SummaryBox.java b/src/main/java/seedu/address/model/summarybar/SummaryBox.java index 6f37081112a..399edd3eba7 100644 --- a/src/main/java/seedu/address/model/summarybar/SummaryBox.java +++ b/src/main/java/seedu/address/model/summarybar/SummaryBox.java @@ -3,12 +3,20 @@ import java.util.Objects; import java.util.Optional; +/** + * Represents a SummaryBox in InternApply. + */ public abstract class SummaryBox { private String name; private int totalApplications; - + /** + * Constructs a {@Code SummaryBox}. + * + * @param name Name of the SummaryBox. + * @param totalApplications Total number of applications in InternApply. + */ public SummaryBox(String name, int totalApplications) { this.name = name; this.totalApplications = totalApplications; @@ -26,6 +34,12 @@ public void setTotalApplications(int totalApplications) { this.totalApplications = totalApplications; } + /** + * Gets the number of applications this SummaryBox is tracking. + * Returns Optional.empty() for SummaryBoxes that are not tracking any applications. + * + * @return The number of applications this SummaryBox is tracking. + */ public abstract Optional getCurrApplications(); @Override diff --git a/src/main/java/seedu/address/model/summarybar/SummaryList.java b/src/main/java/seedu/address/model/summarybar/SummaryList.java index a4994e354d9..6f72d0aea0c 100644 --- a/src/main/java/seedu/address/model/summarybar/SummaryList.java +++ b/src/main/java/seedu/address/model/summarybar/SummaryList.java @@ -8,6 +8,10 @@ import seedu.address.model.application.Application; import seedu.address.model.tag.Tag; +/** + * A list of SummaryBoxes that keeps track of their respective indices and tags. + * + */ public class SummaryList { private static final int SUMMARY_INFO_SIZE = 6; @@ -28,6 +32,11 @@ public class SummaryList { private ObservableList summaryList; private ObservableList applications; + /** + * Constructs a SummaryList from the given list of applications. + * + * @param applications The list of applications to get the relevant statistics for the SummaryBoxes to hold. + */ public SummaryList(ObservableList applications) { this.applications = applications; summaryList = FXCollections.observableArrayList(); @@ -50,6 +59,12 @@ public ObservableList getObservableList() { return summaryList; } + /** + * Updates the SummaryList by replacing each SummaryBox with a new one holding the updated statistics passed from + * the given list of applications. + * + * @param applications The given list of applications to get statistics from. + */ public void update(ObservableList applications) { this.applications = applications; int[] summaryInfo = new int[SUMMARY_INFO_SIZE]; @@ -73,6 +88,12 @@ private int getTotalApplications() { return applications.size(); } + /** + * Gets the number of applications with the given tagName. + * + * @param tagName The given tagName of the applications search for and count. + * @return + */ private int getTotalTagApplications(String tagName) { int count = 0; Tag toFind = new Tag(tagName); diff --git a/src/main/java/seedu/address/model/summarybar/TagSummaryBox.java b/src/main/java/seedu/address/model/summarybar/TagSummaryBox.java index 6713a1238e1..d7ed2eed3d2 100644 --- a/src/main/java/seedu/address/model/summarybar/TagSummaryBox.java +++ b/src/main/java/seedu/address/model/summarybar/TagSummaryBox.java @@ -3,9 +3,19 @@ import java.util.Objects; import java.util.Optional; +/** + * Represents a SummaryBox in InternApply that keeps track of the number of applications with a specified tagName. + */ public class TagSummaryBox extends SummaryBox { private int currApplications; + /** + * Constructs a TagSummaryBox. + * + * @param name Given name of the TagSummaryBox. + * @param currApplications Number of applications this TagSummaryBox is tracking. + * @param totalApplications Total number of applications in InternApply. + */ TagSummaryBox(String name, int currApplications, int totalApplications) { super(name, totalApplications); this.currApplications = currApplications; diff --git a/src/main/java/seedu/address/model/summarybar/TotalApplicationsBox.java b/src/main/java/seedu/address/model/summarybar/TotalApplicationsBox.java index ab102f1d744..87ed8849a9e 100644 --- a/src/main/java/seedu/address/model/summarybar/TotalApplicationsBox.java +++ b/src/main/java/seedu/address/model/summarybar/TotalApplicationsBox.java @@ -2,8 +2,17 @@ import java.util.Optional; +/** + * Represents a SummaryBox that tracks the total number of applications in InternApply. + */ public class TotalApplicationsBox extends SummaryBox { + /** + * Constructs a TotalApplicationsBox. + * + * @param name The name of this TotalApplicationsBox. + * @param totalApplications Total number of applications in InternApply. + */ public TotalApplicationsBox(String name, int totalApplications) { super(name, totalApplications); } diff --git a/src/main/java/seedu/address/ui/SummaryCard.java b/src/main/java/seedu/address/ui/SummaryCard.java index c47ecce719f..436d105e6c6 100644 --- a/src/main/java/seedu/address/ui/SummaryCard.java +++ b/src/main/java/seedu/address/ui/SummaryCard.java @@ -1,7 +1,5 @@ package seedu.address.ui; -import java.util.Optional; - import javafx.fxml.FXML; import javafx.scene.control.Label; import javafx.scene.layout.HBox; From 64a75261823258b7b16d0a3bffe7b975ae5257ab Mon Sep 17 00:00:00 2001 From: joszx Date: Wed, 30 Mar 2022 00:46:57 +0800 Subject: [PATCH 5/5] Fix README.md and index.md UI image link. --- README.md | 2 +- docs/index.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9b66fe30e3c..c3abce08cda 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ [![Java CI](https://github.com/AY2122S2-CS2103T-T11-3/tp/actions/workflows/gradle.yml/badge.svg)](https://github.com/AY2122S2-CS2103T-T11-3/tp/actions/workflows/gradle.yml) [![codecov](https://codecov.io/gh/AY2122S2-CS2103T-T11-3/tp/branch/master/graph/badge.svg?token=OPX1FSESUJ)](https://codecov.io/gh/AY2122S2-CS2103T-T11-3/tp) -![Ui](docs/images/Ui.png) +![Ui](docs/images/MainWindowUi.png) * This is SoC InternApply
* diff --git a/docs/index.md b/docs/index.md index 5670c039c23..898a8f11a04 100644 --- a/docs/index.md +++ b/docs/index.md @@ -5,7 +5,7 @@ title: InternApply [![CI Status](https://github.com/se-edu/addressbook-level3/workflows/Java%20CI/badge.svg)](https://github.com/AY2122S2-CS2103T-T11-3/tp/actions) [![codecov](https://codecov.io/gh/AY2122S2-CS2103T-T11-3/tp/branch/master/graph/badge.svg?token=OPX1FSESUJ)](https://codecov.io/gh/AY2122S2-CS2103T-T11-3/tp) -![Ui](images/Ui.png) +![Ui](images/MainWindowUi.png) **InternApply is a desktop application for managing your internship application.** While it has a GUI, most of the user interactions happen using a CLI (Command Line Interface).