Commit ff5ec563 authored by Janita Lillevik Røyseth's avatar Janita Lillevik Røyseth
Browse files

Moved around on packages, added and fixed a module-info file, added a README...

Moved around on packages, added and fixed a module-info file, added a README file containing user information to log into the system.
parent 9644d718
Pipeline #133933 failed with stages
in 1 minute and 54 seconds
*********HELSELISTE*************
Utviklere: idata2001 gruppe 5
Sist revidert: 29.04.2021
GitLab: https://gitlab.stud.idi.ntnu.no/ninavma/TODO-List-application/-/tree/master
*********Brukere til systemet****
*********emne-anvsvarlig*********
Kjell Inge Tomren
bruker-id: kjetom
passord: Passord123
*********Testgruppen*************
Solveig Marstrander
bruker-id: solmar
passord: Passord123
Elisabeth Akerø Modahl
bruker-id: eliake
passord: Passord123
Victor Modahl
bruker-id: vicmod
passord: Passord123
Jeevana Arul
bruker-id: jeearu
passord: Passord123
Silje Henningsen
bruker-id: silhen
passord: Passord123
*********Gruppe 5****************
Janita Lillvik Røyseth
bruker-id: janroy
passord: Passord123
Nina Vinding Marstrander
bruker-id: ninmar
passord: Passord123
Winnie Wu
bruker-id: winwu
passord: Passord123
Balendra Sounthararajan
bruker-id: balsou
passord: Passord123
\ No newline at end of file
......@@ -43,7 +43,10 @@
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.5</version>
<configuration>
<mainClass>edu.ntnu.idata1002.prosjekt2021.ui.views.Main</mainClass>
<release>${maven.compiler.target}</release>
<jlinkImageName>HelseListe</jlinkImageName>
<launcher>HelseListeApp</launcher>
<mainClass>edu.ntnu.idata1002.prosjekt2021.ui.Main</mainClass>
</configuration>
</plugin>
</plugins>
......
......@@ -34,6 +34,8 @@ public class Careplan {
/**
* Creates an instance of careplan.
*
* @param typeOfCare the type of cate of the careplan instance.
*/
public Careplan(String typeOfCare){
this.typeOfCare = typeOfCare;
......
......@@ -3,6 +3,10 @@ package edu.ntnu.idata1002.prosjekt2021.model;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
/**
* Represents a journal entry. Holds information about the time
* of the journal entry and the text in the journal entry.
*/
public class JournalEntry {
/**
......
......@@ -33,6 +33,8 @@ public class Nurse {
*
* @param fullName full name of a nurse.
* @param username unique id of a nurse.
* @param password password for the nurses user.
* @param picture the profile picture of the nurse.
*/
public Nurse(String fullName, String username, String password, Image picture){
if(fullName == null || fullName.isBlank() || username == null ||
......
......@@ -94,6 +94,7 @@ public class Patient {
* @param socialSecurityNumber unique socialSecurityNumber of the patient.
* @param city the city where this patient resides.
* @param postalCode the postal code where this patient resides.
* @param picture picture of the patient.
*/
public Patient(String fullName, String address, String phonenumber,
String socialSecurityNumber, String city, int postalCode, Image picture){
......
......@@ -129,6 +129,7 @@ public class Section {
* Removing a patient, if patient is in the list.
*
* @param patient patient to be removed.
* @throws RemoveException if the patient was not removed
*/
public void removePatient(Patient patient) throws RemoveException {
if(patients.contains(patient)) {
......@@ -143,6 +144,7 @@ public class Section {
* Removing a nurse, if nurse is in the list.
*
* @param nurse nurse to be removed.
* @throws RemoveException if the nurse was not removed.
*/
public void removeNurse(Nurse nurse) throws RemoveException{
if(nurses.contains(nurse)) {
......
......@@ -20,7 +20,7 @@ public class SectionList {
* Creates a new instance of sectionlist.
*/
public SectionList() {
this.sections = new ArrayList();
this.sections = new ArrayList<>();
}
/**
......
......@@ -17,7 +17,7 @@ public class TestData {
// Creating patients and nurses.
Patient patient1 = new Patient("Anne Panne","Borgundvegen 150","+4793204324",
"020445 12345", "Ålesund", 6011, new Image("DummyPatientPhotos/annepanne.png"));
"020445 12345", "Ålesund", 6011, new Image(getImage("/DummyPatientPhotos/annepanne.png")));
patient1.setEmergencyContact(new Contact("Hanne Panne", "+4799605346"));
patient1.setGeneralPractitioner(new Contact("Doktor Brille", "+4770940022"));
patient1.setSummary("Bekkensbrudd, bruker preikestol, ustødig.");
......@@ -40,7 +40,7 @@ public class TestData {
patient1.findCareplanByTypeOfCare("Legemidler").addTask(new TodoTask("Paracet", "08:00"));
Patient patient2 = new Patient("Nils Nesevis","Borgundvegen 103","+4744324402",
"240739 12346", "Ålesund",6012, new Image("DummyPatientPhotos/nilsnesevis.png"));
"240739 12346", "Ålesund",6012, new Image(getImage("/DummyPatientPhotos/nilsnesevis.png")));
patient2.setEmergencyContact(new Contact("Nora Nesevis", "+4790340202"));
patient2.setGeneralPractitioner(new Contact("Doktor Brille", "+4770940022"));
patient2.setSummary("Bekkensbrudd, bruker preikestol, ustødig.");
......@@ -61,7 +61,7 @@ public class TestData {
patient2.findCareplanByTypeOfCare("Sosial og aktivitet").addTask(new TodoTask("Bistå med å ringe datter", "Kveld"));
Patient patient3 = new Patient("Lars Lapskaus","Hatlevika 35","+4793043423",
"091241 12347", "Ålesund",6011, new Image("DummyPatientPhotos/larslapskaus.png"));
"091241 12347", "Ålesund",6011, new Image(getImage("/DummyPatientPhotos/larslapskaus.png")));
patient3.setEmergencyContact(new Contact("Lisa Lapskays", "+4794328464"));
patient3.setGeneralPractitioner(new Contact("Doktor Brille", "+4770940022"));
patient3.setSummary("Bekkensbrudd, bruker preikestol, ustødig.");
......@@ -82,7 +82,7 @@ public class TestData {
patient3.findCareplanByTypeOfCare("Sosial og aktivitet").addTask(new TodoTask("Trappetrening", "Kveld"));
Patient patient4 = new Patient("Ola Nordmann","Hatlesvingen 25","+4791394342",
"170132 12348", "Ålesund",6010, new Image("DummyPatientPhotos/olanordmann.png"));
"170132 12348", "Ålesund",6010, new Image(getImage("/DummyPatientPhotos/olanordmann.png")));
patient4.setEmergencyContact(new Contact("Pia Nordmann", "+4790438243"));
patient4.setGeneralPractitioner(new Contact("Doktor Brille", "+4770940022"));
patient4.setSummary("Bekkensbrudd, bruker preikestol, ustødig.");
......@@ -99,7 +99,7 @@ public class TestData {
patient4.findCareplanByTypeOfCare("Personlig hygiene").addTask(new TodoTask("Kveldstell", "Kveld"));
Patient patient5 = new Patient("Kari Nordmann","Indre Hatlen 47","+4743234042",
"291230 12349", "Ålesund",6010, new Image("DummyPatientPhotos/karinordmann.png"));
"291230 12349", "Ålesund",6010, new Image(getImage("/DummyPatientPhotos/karinordmann.png")));
patient5.setEmergencyContact(new Contact("Per Nordmann", "+4745045823"));
patient5.setGeneralPractitioner(new Contact("Doktor Proktor", "+4770945500"));
patient5.setSummary("Bekkensbrudd, bruker preikestol, ustødig.");
......@@ -123,7 +123,7 @@ public class TestData {
patient5.findCareplanByTypeOfCare("Sosial og aktivitet").addTask(new TodoTask("Øvelser fra fysioteraput", "Kveld"));
Patient patient6 = new Patient("Mari Maurskog","Hatlabakken 5","+4743424324",
"130334 123472", "Ålesund",6011, new Image("DummyPatientPhotos/marimaurskog.png"));
"130334 123472", "Ålesund",6011, new Image(getImage("/DummyPatientPhotos/marimaurskog.png")));
patient6.setEmergencyContact(new Contact("Martin Marihøne", "+4793840234"));
patient6.setGeneralPractitioner(new Contact("Doktor Proktor", "+4770945500"));
patient6.setSummary("Bekkensbrudd, bruker preikestol, ustødig.");
......@@ -147,7 +147,7 @@ public class TestData {
patient6.findCareplanByTypeOfCare("Sosial og aktivitet").addTask(new TodoTask("Øvelser fra fysioteraput", "Kveld"));
Patient patient7 = new Patient("Solveig Lysgate","Hatlabakken 24","+4795435323",
"141130 123473", "Ålesund",6011, new Image("DummyPatientPhotos/solveiglysgate.png"));
"141130 123473", "Ålesund",6011, new Image(getImage("/DummyPatientPhotos/solveiglysgate.png")));
patient7.setEmergencyContact(new Contact("Luna Lysgate", "+4793849346"));
patient7.setGeneralPractitioner(new Contact("Doktor Proktor", "+4770945500"));
patient7.setSummary("Bekkensbrudd, bruker preikestol, ustødig.");
......@@ -172,7 +172,7 @@ public class TestData {
patient7.findCareplanByTypeOfCare("Sosial og aktivitet").addTask(new TodoTask("Øvelser fra fysioteraput", "Kveld"));
Patient patient8 = new Patient("Ingrid Langveg","Indre Hatlen 2","+4794342424",
"120341 123474", "Ålesund",6012, new Image("DummyPatientPhotos/ingridlangveg.png"));
"120341 123474", "Ålesund",6012, new Image(getImage("/DummyPatientPhotos/ingridlangveg.png")));
patient8.setEmergencyContact(new Contact("Ingo Langveg", "+4744038324"));
patient8.setGeneralPractitioner(new Contact("Doktor Proktor", "+4770945500"));
patient8.setSummary("Bor med mann, trenger bistand til morgen og kveldstell");
......@@ -195,16 +195,16 @@ public class TestData {
patient8.findCareplanByTypeOfCare("Sosial og aktivitet").addTask(new TodoTask("Tur", "Kveld"));
patient8.findCareplanByTypeOfCare("Sosial og aktivitet").addTask(new TodoTask("Øvelser fra fysioteraput", "Kveld"));
Nurse nurse1 = new Nurse("Elisabeth Akerø Modahl", "eliake", "Passord123", new Image("UsersPhotos/elisabeth.png"));
Nurse nurse2 = new Nurse("Victor Modahl", "vicmod", "Passord123", new Image("UsersPhotos/victor.png"));
Nurse nurse3 = new Nurse("Solveig Marstrander","solmar","Passord123", new Image("UsersPhotos/nouserpic.png"));
Nurse nurse4 = new Nurse("Silje Henningsen","silhen","Passord123", new Image("UsersPhotos/nouserpic.png"));
Nurse nurse5 = new Nurse("Jeevana Arul", "jeearu", "Passord123", new Image("UsersPhotos/nouserpic.png"));
Nurse nurse6 = new Nurse("Janita Lillevik Røyseth", "janroy", "Passord123", new Image("UsersPhotos/janita.png"));
Nurse nurse7 = new Nurse("Nina Vinding Marstrander", "ninmar", "Passord123", new Image("UsersPhotos/nina.jpeg"));
Nurse nurse8 = new Nurse("Winnie Wu", "winwu", "Passord123", new Image("UsersPhotos/winnie.png"));
Nurse nurse9 = new Nurse("Balendra Sounthararajan", "balsou", "Passord123", new Image("UsersPhotos/balendra.png"));
Nurse nurse10 = new Nurse("Kjell Inge Tomren", "kjetom", "Passord123", new Image("UsersPhotos/kjellinge.jpeg"));
Nurse nurse1 = new Nurse("Elisabeth Akerø Modahl", "eliake", "Passord123", new Image(getImage("/UsersPhotos/elisabeth.png")));
Nurse nurse2 = new Nurse("Victor Modahl", "vicmod", "Passord123", new Image(getImage("/UsersPhotos/victor.png")));
Nurse nurse3 = new Nurse("Solveig Marstrander","solmar","Passord123", new Image(getImage("/UsersPhotos/nouserpic.png")));
Nurse nurse4 = new Nurse("Silje Henningsen","silhen","Passord123", new Image(getImage("/UsersPhotos/nouserpic.png")));
Nurse nurse5 = new Nurse("Jeevana Arul", "jeearu", "Passord123", new Image(getImage("/UsersPhotos/nouserpic.png")));
Nurse nurse6 = new Nurse("Janita Lillevik Røyseth", "janroy", "Passord123", new Image(getImage("/UsersPhotos/janita.png")));
Nurse nurse7 = new Nurse("Nina Vinding Marstrander", "ninmar", "Passord123", new Image(getImage("/UsersPhotos/nina.jpeg")));
Nurse nurse8 = new Nurse("Winnie Wu", "winwu", "Passord123", new Image(getImage("/UsersPhotos/winnie.png")));
Nurse nurse9 = new Nurse("Balendra Sounthararajan", "balsou", "Passord123", new Image(getImage("/UsersPhotos/balendra.png")));
Nurse nurse10 = new Nurse("Kjell Inge Tomren", "kjetom", "Passord123", new Image(getImage("/UsersPhotos/kjellinge.jpeg")));
// Creating section and adding patients and nurses.
Section hatlane = new Section("Hatlane");
......@@ -228,4 +228,8 @@ public class TestData {
hatlane.addPatient(patient7);
hatlane.addPatient(patient8);
}
private static String getImage(String path) {
return TestData.class.getResource(path).toExternalForm();
}
}
package edu.ntnu.idata1002.prosjekt2021.ui.controllers;
package edu.ntnu.idata1002.prosjekt2021.ui;
import edu.ntnu.idata1002.prosjekt2021.model.*;
import edu.ntnu.idata1002.prosjekt2021.ui.views.*;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.EventHandler;
......@@ -21,6 +20,9 @@ import javafx.stage.Stage;
import java.io.IOException;
import java.util.*;
/**
* Controller for the careplan scene.
*/
public class CarePlanController {
/**
......@@ -152,7 +154,11 @@ public class CarePlanController {
* Constant values for how the lists are displayed.
*/
public enum ButtonList{
ALL, MORNING, AFTERNOON, EVENING, NIGHT
ALL,
MORNING,
AFTERNOON,
EVENING,
NIGHT
}
/**
......@@ -370,11 +376,16 @@ public class CarePlanController {
private void logout() {
Parent root = null;
try {
root = FXMLLoader.load(getClass().getClassLoader().
getResource("FXML scenes/Loginpage.fxml"));
Main.getStage().setScene(new Scene(root));
FXMLLoader loader = new FXMLLoader(getClass().
getResource("Loginpage.fxml"));
root = loader.load();
Scene scene = new Scene(root);
scene.getStylesheets().add(getClass().getResource("/Stylesheets/application.css").toExternalForm());
Main.getStage().setScene(scene);
Main.getStage().sizeToScene();
} catch (Exception e) { }
} catch (IOException e) {
e.printStackTrace();
}
}
/**
......@@ -384,15 +395,15 @@ public class CarePlanController {
private void goBack() {
Parent root = null;
try {
FXMLLoader loader = new FXMLLoader(getClass().getResource("/FXML scenes/Patientpage.fxml"));
FXMLLoader loader = new FXMLLoader(getClass().getResource("Patientpage.fxml"));
root = loader.load();
PatientPageController controller = loader.getController();
controller.setUserLabel(getUserLabel());
controller.setUserPicture(getUserPicture());
Scene scene = new Scene(root);
Main.getStage().setScene(scene);
Main.getStage().getScene().getStylesheets().add(getClass().getClassLoader()
.getResource("Stylesheets/application.css").toExternalForm());
Main.getStage().getScene().getStylesheets().add(getClass()
.getResource("/Stylesheets/application.css").toExternalForm());
Main.getStage().sizeToScene();
} catch (IOException e) {
e.printStackTrace();
......@@ -753,8 +764,8 @@ public class CarePlanController {
* the careplans.
*/
private void patientinfo () {
FXMLLoader loader = new FXMLLoader(getClass().getClassLoader().
getResource("FXML scenes/PatientInfo.fxml"));
FXMLLoader loader = new FXMLLoader(getClass().
getResource("PatientInfo.fxml"));
try {
Parent root = loader.load();
PatientInfoController controller = loader.getController();
......@@ -767,8 +778,8 @@ public class CarePlanController {
controller.setStage(stage);
Scene scene = new Scene(root);
stage.setScene(scene);
stage.getScene().getStylesheets().add(getClass().getClassLoader().
getResource("Stylesheets/pasientinfo.css").toExternalForm());
stage.getScene().getStylesheets().add(getClass().
getResource("/Stylesheets/pasientinfo.css").toExternalForm());
stage.show();
Main.getStage().setOnCloseRequest(windowEvent -> stage.close());
} catch (IOException e) {
......@@ -782,7 +793,7 @@ public class CarePlanController {
*/
private void setButtonsToListView(HBox toolbar, ListView listView) {
Button addTask = new Button();
Image addImage = new Image(getClass().getClassLoader().getResource("Icons/add.png").toExternalForm());
Image addImage = new Image(getClass().getResource("/Icons/add.png").toExternalForm());
ImageView addIcon = new ImageView(addImage);
addIcon.setPreserveRatio(true);
addIcon.setFitWidth(25);
......@@ -802,6 +813,7 @@ public class CarePlanController {
TaskDetailsDialog taskDetailsDialog = new TaskDetailsDialog();
Optional<TodoTask> result = taskDetailsDialog.showAndWait();
if (result.isPresent()) {
TodoTask todoTask = result.get();
careplan.getTasks().add(todoTask);
setObservableLists();
......@@ -810,7 +822,7 @@ public class CarePlanController {
});
Button changeTask = new Button();
Image changeImage = new Image(getClass().getClassLoader().getResource("Icons/edit.png").toExternalForm());
Image changeImage = new Image(getClass().getResource("/Icons/edit.png").toExternalForm());
ImageView changeIcon = new ImageView(changeImage);
changeIcon.setPreserveRatio(true);
changeIcon.setFitWidth(25);
......@@ -839,7 +851,7 @@ public class CarePlanController {
});
Button removeTask = new Button();
Image removeImage = new Image(getClass().getClassLoader().getResource("Icons/remove.png").toExternalForm());
Image removeImage = new Image(getClass().getResource("/Icons/remove.png").toExternalForm());
ImageView removeIcon = new ImageView(removeImage);
removeIcon.setPreserveRatio(true);
removeIcon.setFitWidth(25);
......@@ -864,7 +876,7 @@ public class CarePlanController {
});
Button moveTaskUp = new Button();
Image moveTaskUpImage = new Image(getClass().getClassLoader().getResource("Icons/up.png").toExternalForm());
Image moveTaskUpImage = new Image(getClass().getResource("/Icons/up.png").toExternalForm());
ImageView moveTaskUpIcon = new ImageView(moveTaskUpImage);
moveTaskUpIcon.setPreserveRatio(true);
moveTaskUpIcon.setFitWidth(25);
......@@ -892,7 +904,7 @@ public class CarePlanController {
});
Button moveTaskDown = new Button();
Image moveTaskDownImage = new Image(getClass().getClassLoader().getResource("Icons/down.png").toExternalForm());
Image moveTaskDownImage = new Image(getClass().getResource("/Icons/down.png").toExternalForm());
ImageView moveTaskDownIcon = new ImageView(moveTaskDownImage);
moveTaskDownIcon.setPreserveRatio(true);
moveTaskDownIcon.setFitWidth(25);
......@@ -920,7 +932,7 @@ public class CarePlanController {
});
Button moveTaskToBottom = new Button();
Image moveTaskToBottomImage = new Image(getClass().getClassLoader().getResource("Icons/bottom.png").toExternalForm());
Image moveTaskToBottomImage = new Image(getClass().getResource("/Icons/bottom.png").toExternalForm());
ImageView moveTaskToBottomIcon = new ImageView(moveTaskToBottomImage);
moveTaskToBottomIcon.setPreserveRatio(true);
moveTaskToBottomIcon.setFitWidth(25);
......@@ -948,7 +960,7 @@ public class CarePlanController {
});
Button moveTaskToTop = new Button();
Image moveTaskToTopImage = new Image(getClass().getClassLoader().getResource("Icons/top.png").toExternalForm());
Image moveTaskToTopImage = new Image(getClass().getResource("/Icons/top.png").toExternalForm());
ImageView moveTaskToTopIcon = new ImageView(moveTaskToTopImage);
moveTaskToTopIcon.setPreserveRatio(true);
moveTaskToTopIcon.setFitWidth(25);
......
package edu.ntnu.idata1002.prosjekt2021.ui.controllers;
package edu.ntnu.idata1002.prosjekt2021.ui;
import edu.ntnu.idata1002.prosjekt2021.model.Model;
import edu.ntnu.idata1002.prosjekt2021.model.Nurse;
......@@ -10,7 +10,6 @@ import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import edu.ntnu.idata1002.prosjekt2021.ui.views.Main;
import java.io.IOException;
......@@ -57,14 +56,14 @@ public class LoginController {
Parent root = null;
try {
FXMLLoader loader = new FXMLLoader(getClass().getClassLoader().
getResource("FXML scenes/PatientPage.fxml"));
FXMLLoader loader = new FXMLLoader(getClass().
getResource("PatientPage.fxml"));
root = loader.load();
PatientPageController controller = loader.getController();
controller.setUserLabel(nurse.getFullName());
controller.setUserPicture(nurse.getPicture());
Scene scene = new Scene(root);
scene.getStylesheets().add(getClass().getClassLoader().getResource("Stylesheets/application.css").toExternalForm());
scene.getStylesheets().add(getClass().getResource("/Stylesheets/application.css").toExternalForm());
Main.getStage().setScene(scene);
Main.getStage().sizeToScene();
} catch (IOException e) {
......
package edu.ntnu.idata1002.prosjekt2021.ui.views;
package edu.ntnu.idata1002.prosjekt2021.ui;
import java.io.IOException;
import edu.ntnu.idata1002.prosjekt2021.model.SectionList;
import edu.ntnu.idata1002.prosjekt2021.model.TestData;
import javafx.application.Application;
......@@ -10,6 +9,9 @@ import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
/**
* Starts the application.
*/
public class Main extends Application {
private static Stage mainStage;
......@@ -21,12 +23,12 @@ public class Main extends Application {
try {
SectionList sectionList = new SectionList();
TestData.hospitalListTestData(sectionList);
FXMLLoader loader = new FXMLLoader(getClass().getClassLoader().getResource("FXML scenes/Loginpage.fxml"));
FXMLLoader loader = new FXMLLoader(getClass().getResource("Loginpage.fxml"));
root = loader.load();
mainStage = primaryStage;
primaryStage.setTitle("HelseListe");
Scene scene = new Scene(root);
scene.getStylesheets().add(getClass().getClassLoader().getResource("Stylesheets/application.css").toExternalForm());
scene.getStylesheets().add(getClass().getResource("/Stylesheets/application.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.setResizable(false);
primaryStage.show();
......@@ -35,6 +37,11 @@ public class Main extends Application {
}
}
/**
* Returns the stage used when initilizing the application.
*
* @return stage used when initilizing the application.
*/
public static Stage getStage() {
return mainStage;
}
......
package edu.ntnu.idata1002.prosjekt2021.ui.controllers;
package edu.ntnu.idata1002.prosjekt2021.ui;
import edu.ntnu.idata1002.prosjekt2021.model.*;
import edu.ntnu.idata1002.prosjekt2021.ui.views.*;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
......@@ -12,11 +11,10 @@ import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.stage.Stage;
import java.io.IOException;
import java.text.Format;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* Controller for the patientinfo scene.
*/
public class PatientInfoController {
/**
......@@ -145,8 +143,8 @@ public class PatientInfoController {
stage.close();
Parent root = null;
try {
FXMLLoader loader = new FXMLLoader(getClass().getClassLoader().
getResource("FXML scenes/CarePlan.fxml"));
FXMLLoader loader = new FXMLLoader(getClass()
.getResource("CarePlan.fxml"));
root = loader.load();
CarePlanController controller = loader.getController();
controller.setPatientLabel(patient.getFullName());
......@@ -156,8 +154,8 @@ public class PatientInfoController {
Scene scene = new Scene(root);
this.stage.close();
Main.getStage().setScene(scene);
Main.getStage().getScene().getStylesheets().add(getClass().getClassLoader()
.getResource("Stylesheets/application.css").toExternalForm());
Main.getStage().getScene().getStylesheets().add(getClass().
getResource("/Stylesheets/application.css").toExternalForm());
Main.getStage().sizeToScene();
} catch (IOException e) {
e.printStackTrace();
......
package edu.ntnu.idata1002.prosjekt2021.ui.controllers;
package edu.ntnu.idata1002.prosjekt2021.ui;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import edu.ntnu.idata1002.prosjekt2021.model.*;
import edu.ntnu.idata1002.prosjekt2021.ui.views.Main;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.EventHandler;
......@@ -143,14 +142,16 @@ public class PatientPageController {
private void logout() {
Parent root = null;
try {
root = FXMLLoader.load(getClass().getClassLoader().
getResource("FXML scenes/Loginpage.fxml"));
FXMLLoader loader = new FXMLLoader(getClass().
getResource("Loginpage.fxml"));
root = loader.load();
Scene scene = new Scene(root);
scene.getStylesheets().add(getClass().getResource("/Stylesheets/application.css").toExternalForm());
Main.getStage().setScene(scene);
Main.getStage().getScene().getStylesheets().add(getClass().getClassLoader()
.getResource("Stylesheets/application.css").toExternalForm());
Main.getStage().sizeToScene();
} catch (Exception e) { }
} catch (IOException e) {
e.printStackTrace();
}
}
/**
......@@ -267,7 +268,7 @@ public class PatientPageController {
* @return patientinfo button.
*/
private Button setPatientInfoButton() {
ImageView patienInfoIcon = new ImageView(new Image("Icons/pasientinfo.png"));
ImageView patienInfoIcon = new ImageView(new Image(getClass().getResource("/Icons/pasientinfo.png").toExternalForm()));
patienInfoIcon.setFitHeight(50);
patienInfoIcon.setFitWidth(50);
Button patientInfo = new Button("Pasientinfo", patienInfoIcon);
......@@ -284,7 +285,7 @@ public class PatientPageController {
* @return careplan button.
*/
private Button setPatientGridCarePlanButton() {
ImageView carePlanIcon = new ImageView(new Image("Icons/journal.png"));
ImageView carePlanIcon = new ImageView(new Image(getClass().getResource("/Icons/journal.png").toExternalForm()));
carePlanIcon.setFitWidth(50);
carePlanIcon.setFitHeight(50);
Button carePlan = new Button("Tiltaksplan", carePlanIcon);
......@@ -332,8 +333,8 @@ public class PatientPageController {
private void carePlan ( Patient patient) {
Parent root = null;
try {