forked from nus-cs2103-AY2324S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
241 additions
and
9 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
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,74 @@ | ||
package seedu.address.ui; | ||
|
||
import java.util.Comparator; | ||
import java.util.logging.Logger; | ||
|
||
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.commons.core.LogsCenter; | ||
import seedu.address.logic.commands.ViewCommand; | ||
import seedu.address.model.person.Person; | ||
|
||
/** | ||
* An UI component that displays information of a {@code Person}. | ||
*/ | ||
public class ViewWindow extends UiPart<Region> { | ||
|
||
private static final String FXML = "ViewWindow.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 Person person; | ||
|
||
@FXML | ||
private HBox cardPane; | ||
@FXML | ||
private Label name; | ||
@FXML | ||
private Label id; | ||
@FXML | ||
private Label phone; | ||
@FXML | ||
private Label address; | ||
@FXML | ||
private Label email; | ||
@FXML | ||
private FlowPane tags; | ||
|
||
@FXML | ||
private Label otherInfo; | ||
private static final Logger logger = LogsCenter.getLogger(ViewWindow.class); | ||
|
||
/** | ||
* Creates a {@code PersonCode} with the given {@code Person} and index to display. | ||
*/ | ||
public ViewWindow(Person person, int displayedIndex) { | ||
super(FXML); | ||
this.person = person; | ||
id.setText(displayedIndex + "."); | ||
name.setText(person.getName().fullName); | ||
phone.setText(person.getPhone().value); | ||
address.setText(person.getAddress().value); | ||
email.setText(person.getEmail().value); | ||
|
||
Label label = new Label(person.getType().value); | ||
if (person.isClient()) { | ||
label.getStyleClass().add("client-label"); | ||
} else { | ||
label.getStyleClass().add("lead-label"); | ||
} | ||
tags.getChildren().add(label); | ||
person.getTags().stream() | ||
.sorted(Comparator.comparing(tag -> tag.tagName)) | ||
.forEach(tag -> tags.getChildren().add(new Label(tag.tagName))); | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,21 @@ | ||
#cardPane { | ||
-fx-background-color: #FBFBD4; | ||
} | ||
.label { | ||
-fx-font-family: "Arial"; | ||
-fx-font-size: 18px; | ||
} | ||
.cell_big_label { | ||
-fx-font-size: 24px; | ||
-fx-font-weight: bold; | ||
-fx-text-fill: #666; | ||
-fx-padding: 10px; | ||
} | ||
|
||
|
||
.cell_small_label { | ||
-fx-font-size: 18px; | ||
-fx-text-fill: #999; | ||
-fx-padding: 5px; | ||
} | ||
|
Oops, something went wrong.