From 5063b9dde8828f72d9e1795af961add581ac6b97 Mon Sep 17 00:00:00 2001 From: chonguschonguschongus Date: Thu, 2 Nov 2023 22:14:08 +0800 Subject: [PATCH] Enhance looks and feel of Ui --- .../java/seedu/address/ui/DoctorCard.java | 10 +- .../java/seedu/address/ui/PatientCard.java | 11 +- .../resources/view/AppointmentListCard.fxml | 2 +- src/main/resources/view/DarkTheme.css | 157 +++++++++--------- src/main/resources/view/DoctorListCard.fxml | 2 +- src/main/resources/view/DoctorListPanel.fxml | 2 +- src/main/resources/view/PatientListCard.fxml | 2 +- src/main/resources/view/PatientListPanel.fxml | 2 +- 8 files changed, 95 insertions(+), 93 deletions(-) diff --git a/src/main/java/seedu/address/ui/DoctorCard.java b/src/main/java/seedu/address/ui/DoctorCard.java index a1adde8421a..03bb12a041b 100644 --- a/src/main/java/seedu/address/ui/DoctorCard.java +++ b/src/main/java/seedu/address/ui/DoctorCard.java @@ -69,8 +69,12 @@ public DoctorCard(Doctor doctor, int displayedIndex) { .forEach(tag -> tags.getChildren().add(new Label(tag.tagName))); doctor.getAppointments().stream() .sorted(Comparator.comparing(Appointment::getAppointmentTime)) - .forEach(appointment -> appointments.getChildren() - .add(new Label("Appointment with Patient: " + appointment.getPatient() + " at " - + appointment.getAppointmentTime().format(Appointment.FORMATTER)))); + .forEach(appointment -> { + Label appointmentLabel = new Label("Appointment with Patient: " + appointment.getPatient() + " at " + + appointment.getAppointmentTime().format(Appointment.FORMATTER)); + appointmentLabel.setWrapText(true); // Enable text wrapping + appointmentLabel.setPrefWidth(250); // Set the maximum width for text wrapping (adjust as needed) + appointments.getChildren().add(appointmentLabel); + }); } } diff --git a/src/main/java/seedu/address/ui/PatientCard.java b/src/main/java/seedu/address/ui/PatientCard.java index 9bf55822534..a138424b62a 100644 --- a/src/main/java/seedu/address/ui/PatientCard.java +++ b/src/main/java/seedu/address/ui/PatientCard.java @@ -75,10 +75,13 @@ public PatientCard(Patient person, int displayedIndex) { .forEach(tag -> tags.getChildren().add(new Label(tag.tagName))); person.getAppointments().stream() .sorted(Comparator.comparing(Appointment::getAppointmentTime)) - .forEach(appointment -> appointments.getChildren() - .add(new Label("Appointment with Doctor: " + appointment.getDoctor() + " at " - + appointment.getAppointmentTime().format(Appointment.FORMATTER)))); - + .forEach(appointment -> { + Label appointmentLabel = new Label("Appointment with Doctor: " + appointment.getDoctor() + " at " + + appointment.getAppointmentTime().format(Appointment.FORMATTER)); + appointmentLabel.setWrapText(true); // Enable text wrapping + appointmentLabel.setPrefWidth(250); // Set the maximum width for text wrapping (adjust as needed) + appointments.getChildren().add(appointmentLabel); + }); condition.setText("Condition: " + person.getCondition().value); bloodType.setText("Blood Type: " + person.getBloodType().value); emergencyContact.setText("Emergency Contact: " + person.getEmergencyContact().value); diff --git a/src/main/resources/view/AppointmentListCard.fxml b/src/main/resources/view/AppointmentListCard.fxml index 7fcabe022e8..78dca91284c 100644 --- a/src/main/resources/view/AppointmentListCard.fxml +++ b/src/main/resources/view/AppointmentListCard.fxml @@ -17,7 +17,7 @@ - -