diff --git a/ProGYMHOME/.idea/misc.xml b/ProGYMHOME/.idea/misc.xml index 001e756..f5287b0 100644 --- a/ProGYMHOME/.idea/misc.xml +++ b/ProGYMHOME/.idea/misc.xml @@ -8,7 +8,7 @@ - + \ No newline at end of file diff --git a/ProGYMHOME/lib/error_prone_annotations-2.36.0.jar b/ProGYMHOME/lib/error_prone_annotations-2.36.0.jar new file mode 100644 index 0000000..740268b Binary files /dev/null and b/ProGYMHOME/lib/error_prone_annotations-2.36.0.jar differ diff --git a/ProGYMHOME/lib/gson-2.12.1.jar b/ProGYMHOME/lib/gson-2.12.1.jar new file mode 100644 index 0000000..ebfdcc3 Binary files /dev/null and b/ProGYMHOME/lib/gson-2.12.1.jar differ diff --git a/ProGYMHOME/pom.xml b/ProGYMHOME/pom.xml index 855fbe0..97c995f 100644 --- a/ProGYMHOME/pom.xml +++ b/ProGYMHOME/pom.xml @@ -11,10 +11,12 @@ UTF-8 + 17 5.10.2 + org.openjfx javafx-controls @@ -25,6 +27,13 @@ javafx-fxml 17.0.6 + + org.openjfx + javafx-web + 17.0.6 + + + org.controlsfx controlsfx @@ -34,29 +43,26 @@ com.dlsc.formsfx formsfx-core 11.6.0 - - - org.openjfx - * - - net.synedra validatorfx 0.5.0 - - - org.openjfx - * - - org.kordamp.bootstrapfx bootstrapfx-core 0.4.0 + + + com.google.code.gson + gson + 2.12.1 + + + + org.junit.jupiter junit-jupiter-api @@ -73,35 +79,32 @@ + org.apache.maven.plugins maven-compiler-plugin 3.13.0 - 23 - 23 + ${java.version} + ${java.version} + + org.openjfx javafx-maven-plugin 0.0.8 - default-cli - com.example.progymhome/com.example.progymhome.HelloApplication + com.example.progymhome.HelloApplication app - app - app - true - true - true - \ No newline at end of file + diff --git a/ProGYMHOME/src/main/java/com/example/exfxwebview/WebView.java b/ProGYMHOME/src/main/java/com/example/exfxwebview/WebView.java new file mode 100644 index 0000000..5d5e381 --- /dev/null +++ b/ProGYMHOME/src/main/java/com/example/exfxwebview/WebView.java @@ -0,0 +1,6 @@ +package com.example.exfxwebview; +import javafx.scene.web.*; + +public class WebView { + +} diff --git a/ProGYMHOME/src/main/java/com/example/progymhome/AddLessonController.java b/ProGYMHOME/src/main/java/com/example/progymhome/AddLessonController.java new file mode 100644 index 0000000..290fc1d --- /dev/null +++ b/ProGYMHOME/src/main/java/com/example/progymhome/AddLessonController.java @@ -0,0 +1,137 @@ +package com.example.progymhome; + +import java.io.IOException; +import java.net.URL; +import java.util.ResourceBundle; + +import com.example.progymhome.Lesson.LessonImage; +import com.example.progymhome.Screen.ScreenBackManager; +import com.example.progymhome.User.UserDetail; +import com.example.progymhome.User.UserListSession; +import com.example.progymhome.User.UserManager; +import com.example.progymhome.User.UserSession; +import javafx.event.EventHandler; +import javafx.fxml.FXML; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.image.ImageView; +import javafx.scene.input.MouseEvent; +import javafx.scene.layout.HBox; +import javafx.scene.layout.VBox; +import javafx.scene.text.Font; +import javafx.scene.text.FontWeight; + +public class AddLessonController { + + @FXML + private ResourceBundle resources; + + @FXML + private URL location; + + @FXML + private VBox lessonContainer; + + @FXML + private Button onClickStarted; + private UserSession userSession; + private UserListSession userListSession; + private UserManager userManager; + private String[] part; + private ScreenBackManager screenBackManager; + private UserDetail userDetail; + + + @FXML + void initialize() { + userManager.loadFromFile("src/main/java/com/example/progymhome/User/userData.json"); + userDetail = userDetail.getInstance(); + userSession = userSession.getInstance(); + userManager = userManager.getInstance(); + userListSession = userDetail.getUserListSession(); + populateLessons(); + + + + } + + public void addLessonToVbox(String name, String set, String rep) { + HBox lessonPane = new HBox(); + lessonPane.setSpacing(10); + lessonPane.setPadding(new Insets(10)); + lessonPane.setStyle("-fx-background-color: lightgray; -fx-border-radius: 5px; -fx-background-radius: 5px;"); + + Label lessonLabel = new Label(name); + Label setLabel = new Label("Sets: " + set); + Label repLabel = new Label("Reps: " + rep); + String nameLabel = getImageVideo(lessonLabel.getText()); + ImageView imageLesson = new ImageView(nameLabel); + imageLesson.setFitWidth(40); + imageLesson.setFitHeight(40); + imageLesson.setPreserveRatio(true); + + Font poppinsBold = Font.font("Poppins", FontWeight.BOLD, 14); + lessonLabel.setFont(poppinsBold); + setLabel.setFont(poppinsBold); + repLabel.setFont(poppinsBold); + + lessonPane.getChildren().addAll(imageLesson, lessonLabel, setLabel, repLabel); + lessonPane.setAlignment(Pos.CENTER_LEFT); + + lessonPane.setOnMouseClicked(new EventHandler() { + @Override + public void handle(MouseEvent mouseEvent) { + try + { + screenBackManager.pushScreen("add-screen.fxml"); + SwitchScreenController.switchToScene1(mouseEvent, "workout-video-screen.fxml"); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + }); + + this.lessonContainer.getChildren().add(lessonPane); + } + + public void populateLessons() { + UserListSession userListSession1 = userDetail.getUserListSession(); + System.out.println(userListSession1); + for (UserSession user : userListSession1.getUsers()) { + System.out.println(user.getNamePratice() + " " + user.getDetailPratice()); + userSession.setNamePratice(user.getNamePratice()); + userSession.setDetailPratice(user.getDetailPratice()); + part = user.splitString(); + String name = user.getNamePratice(); + String set = "", rep = ""; + + if (part.length == 1) { + rep = part[0]; + } else { + set = part[1] + " Sets"; + rep = part[0] + " Reps"; + } + + + addLessonToVbox(name, set, rep); + } + } + + private String getImageVideo(String lessonName) + { + for(LessonImage lesson : LessonImage.values()) + { + if(lesson.name().equalsIgnoreCase(lessonName.replace(" ", "_"))) + { + return lesson.getLinkImage(); + } + else + { + System.out.println("Error"); + } + } + return lessonName; + } +} diff --git a/ProGYMHOME/src/main/java/com/example/progymhome/CustomizeController.java b/ProGYMHOME/src/main/java/com/example/progymhome/CustomizeController.java new file mode 100644 index 0000000..a1bbc2b --- /dev/null +++ b/ProGYMHOME/src/main/java/com/example/progymhome/CustomizeController.java @@ -0,0 +1,218 @@ +package com.example.progymhome; + +import java.io.IOException; + +import com.example.exfxwebview.WebView; +import com.example.progymhome.User.UserSession; +import javafx.event.EventHandler; +import javafx.fxml.FXML; +import javafx.scene.control.Label; +import javafx.scene.image.ImageView; +import javafx.scene.input.MouseEvent; +import javafx.scene.layout.AnchorPane; + +public class CustomizeController { + + @FXML + private AnchorPane OverheadTricep; + + @FXML + private AnchorPane abRoller; + + @FXML + private AnchorPane barbellPress; + + @FXML + private AnchorPane barbellSquat; + + @FXML + private AnchorPane benchPress; + + @FXML + private AnchorPane cableRow; + + @FXML + private AnchorPane cableTricep; + + @FXML + private AnchorPane declinePress; + + @FXML + private AnchorPane dips; + + @FXML + private AnchorPane dumbbellPress; + + @FXML + private AnchorPane dumbbellRaises; + + @FXML + private AnchorPane flyMachine; + + @FXML + private AnchorPane goToChest; + + @FXML + private AnchorPane goToLat; + + @FXML + private AnchorPane goToShoulder; + + @FXML + private AnchorPane goToStomach; + + @FXML + private AnchorPane goToThigh; + + @FXML + private AnchorPane goToTricep; + + @FXML + private AnchorPane halfSquat; + + @FXML + private AnchorPane lateralRaises; + + @FXML + private Label nameSession10; + + @FXML + private Label nameSession11; + + @FXML + private Label nameSession12; + + @FXML + private Label nameSession13; + + @FXML + private Label nameSession14; + + @FXML + private Label nameSession15; + + @FXML + private Label nameSession16; + + @FXML + private Label nameSession17; + + @FXML + private Label nameSession18; + + @FXML + private Label nameSession19; + + @FXML + private Label nameSession2; + + @FXML + private Label nameSession20; + + @FXML + private Label nameSession3; + + @FXML + private Label nameSession4; + + @FXML + private Label nameSession5; + + @FXML + private Label nameSession6; + + @FXML + private Label nameSession7; + + @FXML + private Label nameSession8; + + @FXML + private Label nameSession9; + + @FXML + private Label nameSession1; + + @FXML + private AnchorPane onClickChest; + + @FXML + private AnchorPane onClickShoulder; + + @FXML + private AnchorPane onClickStomach; + + @FXML + private AnchorPane pressMachine; + + @FXML + private AnchorPane pullDown; + + @FXML + private AnchorPane pullUp; + + @FXML + private AnchorPane pushdownTricep; + + @FXML + private AnchorPane splitSquat; + + @FXML + private AnchorPane squat; + + @FXML + private ImageView onClickBack; + + private WebView webView; + private String[] part; + private String videoID; + private UserSession userSession; + + @FXML + void initialize() { + userSession = userSession.getInstance(); + AnchorPane[] workoutPane = { + benchPress,declinePress,dumbbellPress,flyMachine,dips,pressMachine, + abRoller,barbellPress,lateralRaises,dumbbellRaises,cableTricep,OverheadTricep, + pushdownTricep,pullUp,pullDown,cableRow,squat,barbellSquat,splitSquat,halfSquat + }; + Label[] nameLabel ={ + nameSession1, nameSession2,nameSession3,nameSession4,nameSession5,nameSession6, + nameSession7,nameSession8,nameSession9,nameSession10,nameSession11,nameSession12, + nameSession13,nameSession14,nameSession15,nameSession16,nameSession17,nameSession18, + nameSession19,nameSession20 + }; + + onClickBack.setOnMouseClicked(new EventHandler() { + @Override + public void handle(MouseEvent mouseEvent) { + try + { + SwitchScreenController.switchToScene1(mouseEvent, "pratice-screen.fxml"); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + }); + + for (int i = 0 ; i () { + @Override + public void handle(MouseEvent mouseEvent) { + userSession.setNamePratice(nameLabel[tmp].getText()); + try { + SwitchScreenController.openNewWindow1(mouseEvent, "set-rep-and-set-screen.fxml",300,300); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + }); + } + } + } + +} diff --git a/ProGYMHOME/src/main/java/com/example/progymhome/HelloApplication.java b/ProGYMHOME/src/main/java/com/example/progymhome/HelloApplication.java index ccfa5a4..246f976 100644 --- a/ProGYMHOME/src/main/java/com/example/progymhome/HelloApplication.java +++ b/ProGYMHOME/src/main/java/com/example/progymhome/HelloApplication.java @@ -26,10 +26,11 @@ public void start(Stage stage) throws IOException { e.printStackTrace(); System.out.println("Error loading FXML file."); } + } private void loadAllFonts() { - URL fontDirUrl = getClass().getResource("/fonts/"); + URL fontDirUrl = getClass().getResource("/com/example/progymhome/fonts/"); if (fontDirUrl == null) { System.out.println("Font directory not found!"); return; @@ -41,7 +42,7 @@ private void loadAllFonts() { for (File fontFile : Objects.requireNonNull(fontDir.listFiles())) { if (fontFile.getName().endsWith(".ttf") || fontFile.getName().endsWith(".otf")) { try { - String fontPath = "/fonts/" + fontFile.getName(); + String fontPath = "/com/example/progymhome/fonts/" + fontFile.getName(); Font font = Font.loadFont(getClass().getResource(fontPath).toExternalForm(), 20); if (font != null) { System.out.println("Loaded font: " + font.getName()); @@ -55,7 +56,6 @@ private void loadAllFonts() { } } } - } public static void main(String[] args) { diff --git a/ProGYMHOME/src/main/java/com/example/progymhome/Lesson/LessonImage.java b/ProGYMHOME/src/main/java/com/example/progymhome/Lesson/LessonImage.java new file mode 100644 index 0000000..c8c7c7e --- /dev/null +++ b/ProGYMHOME/src/main/java/com/example/progymhome/Lesson/LessonImage.java @@ -0,0 +1,39 @@ +package com.example.progymhome.Lesson; + +public enum LessonImage { + BENCH_PRESS("D:\\Package IDE Java\\ProGYMHOME\\src\\main\\resources\\img\\bench-press.png"), + DEAD_LIFT("D:\\Package IDE Java\\ProGYMHOME\\src\\main\\resources\\img\\deadlift.png"), + DECLINE_PRESS("D:\\Package IDE Java\\ProGYMHOME\\src\\main\\resources\\img\\Decline Press.png"), + DUMBBELL_PRESS("D:\\Package IDE Java\\ProGYMHOME\\src\\main\\resources\\img\\Dumbell Press.png"), + FLY_MACHINE("D:\\Package IDE Java\\ProGYMHOME\\src\\main\\resources\\img\\Fly Machine.png"), + DIPS("D:\\Package IDE Java\\ProGYMHOME\\src\\main\\resources\\img\\dips.png"), + CHEST_PRESS_MACHINE("D:\\Package IDE Java\\ProGYMHOME\\src\\main\\resources\\img\\Chest Press Machine.png"), + AB_ROLLER("D:\\Package IDE Java\\ProGYMHOME\\src\\main\\resources\\img\\Ab Roller.png"), + BARBELL_MILITARY_PRESS("D:\\Package IDE Java\\ProGYMHOME\\src\\main\\resources\\img\\Barbell Military Press.png"), + LATERAL_RAISES("D:\\Package IDE Java\\ProGYMHOME\\src\\main\\resources\\img\\Lateral Raises.png"), + FRONT_DUMBBELL_RAISES("D:\\Package IDE Java\\ProGYMHOME\\src\\main\\resources\\img\\Front Dumbbell Raises.png"), + CABLE_TRICEP("D:\\Package IDE Java\\ProGYMHOME\\src\\main\\resources\\img\\Cable Tricep.png"), + OVERHEAD_TRICEP("D:\\Package IDE Java\\ProGYMHOME\\src\\main\\resources\\img\\Overhead Tricep.png"), + PUSHDOWN_TRICEP("D:\\Package IDE Java\\ProGYMHOME\\src\\main\\resources\\img\\Pushdown Tricep.png"), + PULL_UP("D:\\Package IDE Java\\ProGYMHOME\\src\\main\\resources\\img\\pull-up.png"), + LAT_PULL_DOWN("D:\\Package IDE Java\\ProGYMHOME\\src\\main\\resources\\img\\lat-pulldown-machine.png"), + SEATED_CABLE_ROW("D:\\Package IDE Java\\ProGYMHOME\\src\\main\\resources\\img\\Seated Cable Row.png"), + SQUAT("D:\\Package IDE Java\\ProGYMHOME\\src\\main\\resources\\img\\squat.png"), + BARBELL_SQUAT("D:\\Package IDE Java\\ProGYMHOME\\src\\main\\resources\\img\\Barbell Squat.png"), + SPLIT_SQUAT("D:\\Package IDE Java\\ProGYMHOME\\src\\main\\resources\\img\\Split Squat.png"), + HALF_SQUAT("D:\\Package IDE Java\\ProGYMHOME\\src\\main\\resources\\img\\Half Squat.png"), + SHOULDER_PRESS("D:\\Package IDE Java\\ProGYMHOME\\src\\main\\resources\\img\\shoulder-press.png"), + BICEP_CURL("D:\\Package IDE Java\\ProGYMHOME\\src\\main\\resources\\img\\bicep-curl.png"), + TRICEP_CURL("D:\\Package IDE Java\\ProGYMHOME\\src\\main\\resources\\img\\tricep.png"); + + private final String linkImage; + + LessonImage(String linkImage) + { + this.linkImage = linkImage; + } + + public String getLinkImage() { + return linkImage; + } +} diff --git a/ProGYMHOME/src/main/java/com/example/progymhome/Lesson/LessonLink.java b/ProGYMHOME/src/main/java/com/example/progymhome/Lesson/LessonLink.java new file mode 100644 index 0000000..71fb86f --- /dev/null +++ b/ProGYMHOME/src/main/java/com/example/progymhome/Lesson/LessonLink.java @@ -0,0 +1,51 @@ +package com.example.progymhome.Lesson; + +public enum LessonLink { + BENCH_PRESS("gRVjAtPip0Y"), + DEAD_LIFT("XxWcirHIwVo"), + SHOULDER_PRESS("F3QY5vMz_6I"), + BICEP_CURL("XE_pHwbst04"), + TRICEP_CURL("8nWNyQaEbaM"), + SQUAT("SiVcGBGQ3Rk"), + PUSH_UP("WDIpL0pjun0"), + PULL_UP("aAggnpPyR6E"), + CHILLING("JYNa_9pYLGw"), + WARM_UP("-p0PA9Zt8zk"), + MEDITATION("uwEaQk5VeS4"), + DECLINE_PRESS("Kxt_5D2Rpgg"), + FLY_MACHINE("sAeDw6xhFFw"), + DIPS("o2qX3Zb5mvg"), + CHEST_PRESS_MACHINE("vnd-GBtTMLI"), + AB_ROLLER("zCsW9L2qi-0"), + BARBELL_MILITARY_PRESS("cGnhixvC8uA"), + LATERRAL_RAISES("XPPfnSEATJA"), + FRONT_DUMBBELL_RAISES("5CECBjd7HLQ"), + CABLE_TRICEP("6Fzep104f0s"), + OVERHEAD_TRICEP("1u18yJELsh0"), + PUSHDOWN_TRICEP("m_UlDFNX4mk"), + LAT_PULL_DOWN("NAIEnMjN-6w"), + SEATED_CABLE_ROW("UCXxvVItLoM"), + BARBELL_SQUAT("-bJIpOq-LWk"), + SPLIT_SQUAT("hXpGSa5HYqY"), + HALF_SQUAT("njgjIZdpl50"); + + + + + + + + private final String videoID; + + LessonLink(String videoID) + { + this.videoID = videoID; + } + public String getVideoID() + { + return videoID; + } + + + +} diff --git a/ProGYMHOME/src/main/java/com/example/progymhome/PraticeScreen.java b/ProGYMHOME/src/main/java/com/example/progymhome/PraticeScreen.java index a323794..eff128a 100644 --- a/ProGYMHOME/src/main/java/com/example/progymhome/PraticeScreen.java +++ b/ProGYMHOME/src/main/java/com/example/progymhome/PraticeScreen.java @@ -4,14 +4,19 @@ import java.net.URL; import java.util.ResourceBundle; +import com.example.progymhome.Screen.ScreenBackManager; +import com.example.progymhome.User.UserDetail; +import com.example.progymhome.User.UserListSession; +import com.example.progymhome.User.UserManager; +import com.example.progymhome.User.UserSession; import javafx.event.EventHandler; import javafx.fxml.FXML; +import javafx.scene.control.Label; import javafx.scene.control.ScrollPane; import javafx.scene.image.ImageView; import javafx.scene.input.MouseEvent; import javafx.scene.layout.AnchorPane; import javafx.scene.layout.Pane; -import javafx.scene.layout.VBox; public class PraticeScreen { @@ -21,6 +26,123 @@ public class PraticeScreen { @FXML private URL location; + @FXML + private Label detailSession; + + @FXML + private Label detailSession1; + + @FXML + private Label detailSession10; + + @FXML + private Label detailSession11; + + @FXML + private Label detailSession12; + + @FXML + private Label detailSession13; + + @FXML + private Label detailSession14; + + @FXML + private Label detailSession15; + + @FXML + private Label detailSession16; + + @FXML + private Label detailSession2; + + @FXML + private Label detailSession3; + + @FXML + private Label detailSession4; + + @FXML + private Label detailSession5; + + @FXML + private Label detailSession6; + + @FXML + private Label detailSession7; + + @FXML + private Label detailSession8; + + @FXML + private Label detailSession9; + + @FXML + private Label goToCalis; + + @FXML + private Label goToCardio; + + @FXML + private Label goToGym; + + @FXML + private Label goToMeditation; + + @FXML + private Label goToPower; + + @FXML + private Label nameSession; + + @FXML + private Label nameSession1; + + @FXML + private Label nameSession10; + + @FXML + private Label nameSession11; + + @FXML + private Label nameSession12; + + @FXML + private Label nameSession13; + + @FXML + private Label nameSession14; + + @FXML + private Label nameSession15; + + @FXML + private Label nameSession16; + + @FXML + private Label nameSession2; + + @FXML + private Label nameSession3; + + @FXML + private Label nameSession4; + + @FXML + private Label nameSession5; + + @FXML + private Label nameSession6; + + @FXML + private Label nameSession7; + + @FXML + private Label nameSession8; + + @FXML + private Label nameSession9; + @FXML private ImageView onClickBack; @@ -42,30 +164,161 @@ public class PraticeScreen { @FXML private AnchorPane onClickPower; + @FXML + private AnchorPane getOnClickCustomize; + @FXML private Pane openWorkout; + @FXML private Pane openWorkout1; + @FXML private Pane openWorkout11; + + @FXML + private Pane openWorkout111; + + @FXML + private Pane openWorkout1111; + + @FXML + private Pane openWorkout11111; + + @FXML + private Pane openWorkout111111; + + @FXML + private Pane openWorkout1111111; + + @FXML + private Pane openWorkout11111111; + + @FXML + private Pane openWorkout111111111; + + @FXML + private Pane openWorkout1111111111; + + @FXML + private Pane openWorkout11111111111; + + @FXML + private Pane openWorkout111111111111; + + @FXML + private Pane openWorkout111111111112; + + @FXML + private Pane openWorkout111111111113; + + @FXML + private Pane openWorkout1111111111131; + + @FXML + private Pane openWorkout111111112; + @FXML private ScrollPane scrollToLocation; + + private UserSession userSession; + private UserListSession userListSession; + private UserManager userManager; + private UserDetail userDetail; + @FXML void initialize() { - openWorkout.setOnMouseClicked(new EventHandler() { + + userSession = UserSession.getInstance(); + userListSession = userListSession.getInstance(); + userManager = userManager.getInstance(); + userDetail = userManager.findUser(SignInController.userName); + + + Pane[] workoutPanes = { + openWorkout, openWorkout1, openWorkout11, openWorkout111, openWorkout1111, + openWorkout11111, openWorkout111111, openWorkout1111111, openWorkout11111111, + openWorkout111111111, openWorkout1111111111, openWorkout11111111111, openWorkout111111111111, + openWorkout111111111112, openWorkout111111111113, openWorkout1111111111131, openWorkout111111112 + }; + Label[] nameLabel = { + nameSession, nameSession1, nameSession2, nameSession3, nameSession4, nameSession5, nameSession6, nameSession7, nameSession8, + nameSession9, nameSession10, nameSession11, nameSession12, nameSession13, nameSession14, nameSession15, nameSession16 + }; + Label[] detailLabel = { + detailSession, detailSession1, detailSession2, detailSession3, detailSession4, detailSession5, detailSession6, detailSession7 + , detailSession8, detailSession9, detailSession10, detailSession11, detailSession12, detailSession13, detailSession14, detailSession15, + detailSession16 + }; + //UserListSession newUserList = new UserListSession(); + for (int i = 0; i < workoutPanes.length; ++i) { + if (workoutPanes[i] != null) { + int finalI = i; + workoutPanes[i].setOnMouseClicked(event -> { + // Tạo đối tượng UserSession mới + UserSession newUserSession = new UserSession(); + // Thiết lập các giá trị cho đối tượng UserSession mới + newUserSession.setNamePratice(nameLabel[finalI].getText()); + newUserSession.setDetailPratice(detailLabel[finalI].getText()); + userSession.setNamePratice(nameLabel[finalI].getText()); + userSession.setDetailPratice(detailLabel[finalI].getText()); + handleWorkoutClick(event); + +// newUserList.addUserSession(newUserSession); +// userManager.addUserListSession(newUserList); +// System.out.println(newUserList); + userListSession.addUserSession(newUserSession); + userDetail.setUserListSession(userListSession); + userManager.updateUser(userDetail,"D:\\Package IDE Java\\ProGYMHOME\\src\\main\\java\\com\\example\\progymhome\\User\\userData.json"); + System.out.println(userListSession); + + + + }); + } + } + + + onClickPower.setOnMouseClicked(event -> scrollToLabel(goToPower)); + onClickGym.setOnMouseClicked(event -> scrollToLabel(goToGym)); + onClickCardio.setOnMouseClicked(event -> scrollToLabel(goToCardio)); + onClickMeditation.setOnMouseClicked(event -> scrollToLabel(goToMeditation)); + onClickCalisthenic.setOnMouseClicked(event -> scrollToLabel(goToCalis)); + onClickCustomize.setOnMouseClicked(event -> { + try { + SwitchScreenController.switchToScene1(event, "customize-pratice.fxml"); + } catch (IOException e) { + throw new RuntimeException(e); + } + }); + onClickBack.setOnMouseClicked(new EventHandler() { @Override public void handle(MouseEvent mouseEvent) { - try { - System.out.println("abc"); - SwitchScreenController.switchToScene1(mouseEvent, "workout-video-screen.fxml"); + try + { + SwitchScreenController.switchToScene1(mouseEvent,"profile-screen.fxml"); } catch (IOException e) { throw new RuntimeException(e); } } }); + } + private void handleWorkoutClick(MouseEvent event) { + try { + ScreenBackManager.pushScreen("pratice-screen.fxml"); + SwitchScreenController.switchToScene1(event, "workout-video-screen.fxml"); + } catch (IOException e) { + e.printStackTrace(); + } } + private void scrollToLabel(Label label) { + if (label != null && scrollToLocation != null) { + double yOffset = label.getLayoutY() + 50; + scrollToLocation.setVvalue(yOffset / scrollToLocation.getContent().getBoundsInLocal().getHeight()); + } + } } diff --git a/ProGYMHOME/src/main/java/com/example/progymhome/ProfileScreenController.java b/ProGYMHOME/src/main/java/com/example/progymhome/ProfileScreenController.java index 99e4021..4f2b336 100644 --- a/ProGYMHOME/src/main/java/com/example/progymhome/ProfileScreenController.java +++ b/ProGYMHOME/src/main/java/com/example/progymhome/ProfileScreenController.java @@ -6,7 +6,7 @@ import java.util.ResourceBundle; import com.example.progymhome.User.UserDetail; -import javafx.event.ActionEvent; +import com.example.progymhome.User.UserManager; import javafx.event.EventHandler; import javafx.fxml.FXML; import javafx.scene.control.Button; @@ -38,7 +38,7 @@ public class ProfileScreenController { private ImageView onClickProgress; @FXML - private ImageView onClickSetUp; + private ImageView onClickLogout; @FXML private Text setAgeUser; @@ -59,13 +59,26 @@ public class ProfileScreenController { private Label upLoadImage; private UserDetail user; + private UserManager userManager; + public static String userName; @FXML void initialize() { + System.out.println("abc"); user = user.getInstance(); + userManager = userManager.getInstance(); +// setNameTextFIeld.setText(user.getName()); +// setWeightUser.setText(user.getWeight() + user.getWeightUnit()); +// setHeightUser.setText(user.getHeight() + user.getHeightUnit()); +// setAgeUser.setText(user.getAge() + "y0"); + user = userManager.findUser(SignInController.userName); + System.out.println(user); + if (user != null) { setNameTextFIeld.setText(user.getName()); setWeightUser.setText(user.getWeight() + user.getWeightUnit()); setHeightUser.setText(user.getHeight() + user.getHeightUnit()); - setAgeUser.setText(user.getAge() + "y0"); + setAgeUser.setText(user.getAge() + " years"); + } + upLoadImage.setOnMouseClicked(new EventHandler() { @Override public void handle(MouseEvent mouseEvent) { @@ -94,6 +107,29 @@ public void handle(MouseEvent mouseEvent) { } } }); + onClickProgress.setOnMouseClicked(new EventHandler() { + @Override + public void handle(MouseEvent mouseEvent) { + try + { + SwitchScreenController.switchToScene1(mouseEvent, "user-progress-screen.fxml"); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + }); + onClickLogout.setOnMouseClicked(new EventHandler() { + @Override + public void handle(MouseEvent mouseEvent) { + try + { + SwitchScreenController.switchToScene1(mouseEvent,"sign-in.fxml"); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + }); + } public void upImage(MouseEvent event) { diff --git a/ProGYMHOME/src/main/java/com/example/progymhome/ProfileSetupController.java b/ProGYMHOME/src/main/java/com/example/progymhome/ProfileSetupController.java index 128af32..dbdbd99 100644 --- a/ProGYMHOME/src/main/java/com/example/progymhome/ProfileSetupController.java +++ b/ProGYMHOME/src/main/java/com/example/progymhome/ProfileSetupController.java @@ -7,6 +7,7 @@ import java.util.ResourceBundle; import com.example.progymhome.User.UserDetail; +import com.example.progymhome.User.UserManager; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.fxml.FXML; @@ -51,6 +52,8 @@ public class ProfileSetupController { private UserDetail user; + private UserManager userManager; + public static String userName; @FXML void initialize() { for(MenuItem item : weightUnit.getItems()) @@ -73,7 +76,8 @@ public void handle(MouseEvent mouseEvent) { } }); - user = user.getInstance(); + userManager=userManager.getInstance(); + Alert alert = new Alert(Alert.AlertType.CONFIRMATION); onClickNext.setOnAction(new EventHandler() { @Override @@ -87,16 +91,31 @@ public void handle(ActionEvent actionEvent) { } else { - user.setDateOfBirth(dateOfBirthTextField.getValue()); - user.setName(nameTextField.getText()); - user.setWeight(weightTextField.getText()); - user.setHeight(heightTextField.getText()); - user.setWeightUnit(weightUnit.getText()); - user.setHeightUnit(heightUnit.getText()); - LocalDate now = LocalDate.now(); - int age = Period.between(dateOfBirthTextField.getValue(), now).getYears(); - user.setAge(age); + user = userManager.findUser(userName); + if (user != null) + { + user.setDateOfBirth(dateOfBirthTextField.getValue()); + user.setName(nameTextField.getText()); + if(user.isValidDigit(weightTextField.getText()) && user.isValidDigit(heightTextField.getText())) + { + double weight = Double.parseDouble(weightTextField.getText()); + double height = Double.parseDouble(heightTextField.getText()); + user.setWeight(weight); + user.setHeight(height); + } + + user.setWeightUnit(weightUnit.getText()); + user.setHeightUnit(heightUnit.getText()); + user.changeWeightAndHeight(); + LocalDate now = LocalDate.now(); + int age = Period.between(dateOfBirthTextField.getValue(), now).getYears(); + user.setAge(age); // System.out.println(user.getUsername() + " " + user.getWeight() + user.getWeightUnit() + " " + user.getHeight() + user.getHeightUnit() + " " + user.getPassword() + " " + user.getPhoneNumber() + " " + user.getAge()); + UserManager userManager = UserManager.getInstance(); + userManager.loadFromFile("src/main/java/com/example/progymhome/User/userData.json"); + userManager.updateUser(user, "src/main/java/com/example/progymhome/User/userData.json"); + ProfileScreenController.userName = user.getUsername(); + } diff --git a/ProGYMHOME/src/main/java/com/example/progymhome/Screen/ScreenBackManager.java b/ProGYMHOME/src/main/java/com/example/progymhome/Screen/ScreenBackManager.java new file mode 100644 index 0000000..9e1de5a --- /dev/null +++ b/ProGYMHOME/src/main/java/com/example/progymhome/Screen/ScreenBackManager.java @@ -0,0 +1,21 @@ +package com.example.progymhome.Screen; + +import java.util.Stack; + +public class ScreenBackManager { + public static Stack screenHistory = new Stack<>(); + + public static void pushScreen(String fxml) + { + screenHistory.push(fxml); + } + + public static String popScreen() + { + if(!screenHistory.isEmpty()) + { + return screenHistory.pop(); + } + return null; + } +} diff --git a/ProGYMHOME/src/main/java/com/example/progymhome/SetRepAndSetController.java b/ProGYMHOME/src/main/java/com/example/progymhome/SetRepAndSetController.java new file mode 100644 index 0000000..ffe8303 --- /dev/null +++ b/ProGYMHOME/src/main/java/com/example/progymhome/SetRepAndSetController.java @@ -0,0 +1,162 @@ +package com.example.progymhome; + +import java.io.IOException; +import java.net.URL; +import java.util.ResourceBundle; + +import com.example.progymhome.User.UserDetail; +import com.example.progymhome.User.UserListSession; +import com.example.progymhome.User.UserManager; +import com.example.progymhome.User.UserSession; +import javafx.event.ActionEvent; +import javafx.event.EventHandler; +import javafx.fxml.FXML; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.image.ImageView; +import javafx.scene.input.MouseEvent; +import javafx.stage.Stage; + +public class SetRepAndSetController { + + @FXML + private ResourceBundle resources; + + @FXML + private URL location; + + @FXML + private Label nameLesson; + + @FXML + private Button onClickClose; + + @FXML + private Button onClickOK; + + @FXML + private ImageView onRepDecrease; + + @FXML + private ImageView onRepIncrease; + + @FXML + private ImageView onSetDecrease; + + @FXML + private ImageView onSetIncrease; + + @FXML + private TextField repTextField; + + @FXML + private TextField setTextField; + + private UserSession userSession; + private UserListSession userListSession; + private Stage newStage; + private UserManager userManager; + private UserDetail userDetail; + @FXML + void initialize() { + userSession = userSession.getInstance(); + userListSession= userListSession.getInstance(); + userManager = userManager.getInstance(); + userDetail = userManager.findUser(SignInController.userName); + repTextField.setText("0"); + setTextField.setText("0"); + nameLesson.setText(userSession.getNamePratice()); + System.out.println(nameLesson.getText()); + + onClickClose.setOnAction(new EventHandler() { + @Override + public void handle(ActionEvent actionEvent) { + Stage stage = (Stage) onClickClose.getScene().getWindow(); + stage.close(); + } + }); + onClickOK.setOnAction(new EventHandler() { + @Override + public void handle(ActionEvent actionEvent) { + try { + + UserSession newUserSession = new UserSession(); + + + newUserSession.setDetailPratice(setTextField.getText() + "x" + repTextField.getText()); + System.out.println(setTextField.getText() + " " + repTextField.getText()); + newUserSession.setNamePratice(userSession.getNamePratice()); + + + userListSession.addUserSession(newUserSession); + userDetail.setUserListSession(userListSession); + userManager.updateUser(userDetail,"D:\\Package IDE Java\\ProGYMHOME\\src\\main\\java\\com\\example\\progymhome\\User\\userData.json"); + + + Stage stage = (Stage) onClickClose.getScene().getWindow(); + stage.close(); + + if(newStage == null || !newStage.isShowing()) + { + System.out.println("abc"); + FXMLLoader loader = new FXMLLoader(getClass().getResource("add-screen.fxml")); + Parent root = loader.load(); + + newStage = new Stage(); + Scene scene = new Scene(root); + newStage.setScene(scene); + newStage.show(); + } + else + { + System.out.println("xyz"); + FXMLLoader loader = new FXMLLoader(getClass().getResource("add-screen.fxml")); + Parent root = loader.load(); + + newStage.getScene().setRoot(root); + } + + + } catch (IOException e) { + throw new RuntimeException(e); + } + } + }); + + + onRepIncrease.setOnMouseClicked(new EventHandler() { + @Override + public void handle(MouseEvent mouseEvent) { + int rep = Integer.parseInt(repTextField.getText()); + repTextField.setText(String.valueOf(rep + 1)); + } + }); + onRepDecrease.setOnMouseClicked(new EventHandler() { + @Override + public void handle(MouseEvent mouseEvent) { + int rep = Integer.parseInt(repTextField.getText()); + repTextField.setText(String.valueOf(rep - 1)); + } + }); + onSetIncrease.setOnMouseClicked(new EventHandler() { + @Override + public void handle(MouseEvent mouseEvent) { + int rep = Integer.parseInt(setTextField.getText()); + setTextField.setText(String.valueOf(rep + 1)); + } + }); + onSetDecrease.setOnMouseClicked(new EventHandler() { + @Override + public void handle(MouseEvent mouseEvent) { + int rep = Integer.parseInt(setTextField.getText()); + setTextField.setText(String.valueOf(rep - 1)); + } + }); + + } + +} diff --git a/ProGYMHOME/src/main/java/com/example/progymhome/SignInController.java b/ProGYMHOME/src/main/java/com/example/progymhome/SignInController.java index 1063fc7..4ee6f8e 100644 --- a/ProGYMHOME/src/main/java/com/example/progymhome/SignInController.java +++ b/ProGYMHOME/src/main/java/com/example/progymhome/SignInController.java @@ -12,6 +12,7 @@ import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.TextField; +import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.input.MouseEvent; @@ -38,7 +39,13 @@ public class SignInController { @FXML private TextField usernameTextField; + @FXML + private ImageView showPassword; + + boolean isShowPass; + private UserManager userManager; + static String userName; @FXML void initialize() { @@ -81,6 +88,7 @@ public void handle(ActionEvent actionEvent) { else { try { + userName = usernameTextField.getText(); SwitchScreenController.switchToScene(actionEvent, "profile-screen.fxml"); } catch (IOException e) { throw new RuntimeException(e); @@ -103,5 +111,21 @@ public void handle(MouseEvent mouseEvent) { } } }); + + showPassword.setOnMouseClicked(new EventHandler() { + @Override + public void handle(MouseEvent mouseEvent) { + if (!isShowPass) { + showPassword.setImage(new Image(getClass().getResource("/img/hide.png").toExternalForm())); + passwordTextField.setVisible(false); + isShowPass = true; + } else { + showPassword.setImage(new Image(getClass().getResource("/img/show.png").toExternalForm())); + passwordTextField.setVisible(true); + passwordTextField.setText(passwordTextField.getText()); + isShowPass = false; + } + } + }); } } diff --git a/ProGYMHOME/src/main/java/com/example/progymhome/SignUpController.java b/ProGYMHOME/src/main/java/com/example/progymhome/SignUpController.java index 1050958..904140b 100644 --- a/ProGYMHOME/src/main/java/com/example/progymhome/SignUpController.java +++ b/ProGYMHOME/src/main/java/com/example/progymhome/SignUpController.java @@ -46,6 +46,7 @@ public class SignUpController { public static boolean userExist = true; @FXML void initialize() { + user = user.getInstance(); userManager = userManager.getInstance(); onClickBack.setOnMouseClicked(new EventHandler() { @Override @@ -75,13 +76,36 @@ else if (!passwordTextField.getText().equals(confirmPasswordTextField.getText()) alert.show(); return; } + else { - user = user.getInstance(); - user.setUsername(usernameTextField.getText()); - user.setPassword(passwordTextField.getText()); - userManager.addUser(user); - userExist = false; + if(userManager.checkUserOnList(usernameTextField.getText(), passwordTextField.getText()) == false) + { + if(user.isValidDigit(phoneNumberField.getText())) + { + user = new UserDetail(); + user.setUsername(usernameTextField.getText()); + user.setPassword(passwordTextField.getText()); + user.setPhoneNumber(phoneNumberField.getText()); + ProfileSetupController.userName = user.getUsername(); + userManager.addUser(user); + userManager.saveToFile("src/main/java/com/example/progymhome/User/userData.json"); + userManager.loadFromFile("src/main/java/com/example/progymhome/User/userData.json"); + userExist = false; + } + else + { + alert.setContentText("Your phone number is not correct. Please try again"); + alert.show(); + return; + } + } + else + { + alert.setContentText("Your username is exits. Please change your username"); + alert.show(); + return; + } } try { diff --git a/ProGYMHOME/src/main/java/com/example/progymhome/SwitchScreenController.java b/ProGYMHOME/src/main/java/com/example/progymhome/SwitchScreenController.java index efdd9da..f0f5228 100644 --- a/ProGYMHOME/src/main/java/com/example/progymhome/SwitchScreenController.java +++ b/ProGYMHOME/src/main/java/com/example/progymhome/SwitchScreenController.java @@ -6,30 +6,46 @@ import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; - import javafx.scene.input.MouseEvent; import java.io.IOException; public class SwitchScreenController { - public static Stage stage; - public static Scene scene; - public static Parent root; - public static void switchToScene(ActionEvent event, String fxml) throws IOException { - root = FXMLLoader.load(SwitchScreenController.class.getResource(fxml)); - stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); - scene = new Scene(root); + public static void switchToScene(ActionEvent event, String fxml) throws IOException { + Parent root = FXMLLoader.load(SwitchScreenController.class.getResource(fxml)); + Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + Scene scene = new Scene(root); stage.setScene(scene); stage.show(); } - public static void switchToScene1(MouseEvent event, String fxml) throws IOException { - root = FXMLLoader.load(SwitchScreenController.class.getResource(fxml)); - stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); - scene = new Scene(root); + + public static void switchToScene1(MouseEvent event, String fxml) throws IOException { + Parent root = FXMLLoader.load(SwitchScreenController.class.getResource(fxml)); + Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); + Scene scene = new Scene(root); stage.setScene(scene); stage.show(); } + + public static void openNewWindow(ActionEvent event, String fxml, int width, int height) throws IOException { + FXMLLoader fxmlLoader = new FXMLLoader(SwitchScreenController.class.getResource(fxml)); + Parent root = fxmlLoader.load(); + Scene scene = new Scene(root, width, height); + Stage newStage = new Stage(); + newStage.setScene(scene); + newStage.show(); + } + + + public static void openNewWindow1(MouseEvent event, String fxml, int width, int height) throws IOException { + FXMLLoader fxmlLoader = new FXMLLoader(SwitchScreenController.class.getResource(fxml)); + Parent root = fxmlLoader.load(); + Scene scene = new Scene(root, width, height); + Stage newStage = new Stage(); + newStage.setScene(scene); + newStage.show(); + } } diff --git a/ProGYMHOME/src/main/java/com/example/progymhome/User/LocalDateJson.java b/ProGYMHOME/src/main/java/com/example/progymhome/User/LocalDateJson.java new file mode 100644 index 0000000..477582a --- /dev/null +++ b/ProGYMHOME/src/main/java/com/example/progymhome/User/LocalDateJson.java @@ -0,0 +1,18 @@ +package com.example.progymhome.User; + +import com.google.gson.*; + +import java.lang.reflect.Type; +import java.time.LocalDate; + +public class LocalDateJson implements JsonSerializer, JsonDeserializer { + @Override + public JsonElement serialize(LocalDate date, Type typeOfSrc, JsonSerializationContext context) { + return new JsonPrimitive(date.toString()); // Chuyển đổi LocalDate thành chuỗi + } + + @Override + public LocalDate deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { + return LocalDate.parse(json.getAsString()); // Chuyển chuỗi thành LocalDate + } +} diff --git a/ProGYMHOME/src/main/java/com/example/progymhome/User/UserDetail.java b/ProGYMHOME/src/main/java/com/example/progymhome/User/UserDetail.java index b3a7a7f..c7463ec 100644 --- a/ProGYMHOME/src/main/java/com/example/progymhome/User/UserDetail.java +++ b/ProGYMHOME/src/main/java/com/example/progymhome/User/UserDetail.java @@ -8,12 +8,13 @@ public class UserDetail { private String password; private String phoneNumber; private LocalDate dateOfBirth; - private String height; - private String weight; + private double height; + private double weight; private String weightUnit; private String heightUnit; private Integer age; private static UserDetail instance; + private UserListSession userListSession; public static UserDetail getInstance() { @@ -23,11 +24,22 @@ public static UserDetail getInstance() } return instance; } - + public UserDetail() + { + this.userListSession = new UserListSession(); + } public String getName() { return name; } + public UserListSession getUserListSession() { + return userListSession; + } + + public void setUserListSession(UserListSession userListSession) { + this.userListSession = userListSession; + } + public void setName(String name) { this.name = name; } @@ -64,19 +76,19 @@ public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; } - public String getHeight() { + public double getHeight() { return height; } - public void setHeight(String height) { + public void setHeight(double height) { this.height = height; } - public String getWeight() { + public double getWeight() { return weight; } - public void setWeight(String weight) { + public void setWeight(double weight) { this.weight = weight; } @@ -108,5 +120,36 @@ public boolean isValidLogin(String username, String password) { return this.username.equals(username) && this.password.equals(password); } + public boolean isValidDigit(String temp) + { + for (int i = 0 ; i < temp.length() ; ++i) + { + if(!Character.isDigit(temp.charAt(i))) + { + return false; + } + } + return true; + } + + public void changeWeightAndHeight () + { + if(weightUnit == "Pound") + { + weight *= 0.45; + weightUnit = "Kg"; + } + if(heightUnit == "M") + { + height *= 100; + heightUnit = "Cm"; + } + else if(heightUnit == "feet") + { + height *= 30.48; + heightUnit = "Cm"; + } + } + } diff --git a/ProGYMHOME/src/main/java/com/example/progymhome/User/UserListSession.java b/ProGYMHOME/src/main/java/com/example/progymhome/User/UserListSession.java new file mode 100644 index 0000000..fe4fe4b --- /dev/null +++ b/ProGYMHOME/src/main/java/com/example/progymhome/User/UserListSession.java @@ -0,0 +1,35 @@ +package com.example.progymhome.User; + +import java.util.ArrayList; + +public class UserListSession { + private static UserListSession instance; + private ArrayList users; + + public UserListSession() { + this.users = new ArrayList<>(); + } + + public static UserListSession getInstance() + { + if(instance == null) + { + instance = new UserListSession(); + } + return instance; + } + public void addUserSession(UserSession userSession) + { + users.add(userSession); + } + + public ArrayList getUsers() { + return users; + } + + + + public void setUsers(ArrayList users) { + this.users = users; + } +} diff --git a/ProGYMHOME/src/main/java/com/example/progymhome/User/UserManager.java b/ProGYMHOME/src/main/java/com/example/progymhome/User/UserManager.java index 6591d2d..0c69e66 100644 --- a/ProGYMHOME/src/main/java/com/example/progymhome/User/UserManager.java +++ b/ProGYMHOME/src/main/java/com/example/progymhome/User/UserManager.java @@ -1,14 +1,25 @@ package com.example.progymhome.User; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.reflect.TypeToken; + +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.lang.reflect.Type; +import java.time.LocalDate; import java.util.ArrayList; public class UserManager { private static UserManager instance; private ArrayList users; + public UserManager() { this.users = new ArrayList<>(); + } public static UserManager getInstance() { @@ -21,9 +32,75 @@ public static UserManager getInstance() public void addUser (UserDetail user) { users.add(user); + Gson gson = new GsonBuilder() + .registerTypeAdapter(LocalDate.class, new LocalDateJson()) + .create(); + + String temp = gson.toJson(users); + System.out.println(temp); + saveToFile("D:\\Package IDE Java\\ProGYMHOME\\src\\main\\java\\com\\example\\progymhome\\User\\userData.json"); } +// public void addUserListSession (UserListSession user) +// { +// UserDetail currentUserDetail = UserDetail.getInstance(); +// currentUserDetail.setUserListSession(); +// saveUserToFile("src/main/java/com/example/progymhome/User/userListSessions.json"); +// } + public void saveToFile(String fileName) { + Gson gson = new GsonBuilder() + .registerTypeAdapter(LocalDate.class, new LocalDateJson()) + .create(); + try (FileWriter writer = new FileWriter(fileName)) { + gson.toJson(users, writer); + System.out.println("Dữ liệu đã được lưu vào file " + fileName); + } catch (IOException e) { + e.printStackTrace(); + } + + } + + public void loadFromFile(String fileName) { + Gson gson = new GsonBuilder() + .registerTypeAdapter(LocalDate.class, new LocalDateJson()) + .create(); + try (FileReader reader = new FileReader(fileName)) { + Type userListType = new TypeToken>(){}.getType(); + users = gson.fromJson(reader, userListType); + System.out.println("Dữ liệu đã được tải từ file " + fileName); + } catch (IOException e) { + e.printStackTrace(); + } + } + public void updateUser(UserDetail updatedUser, String fileName) { + loadFromFile("src/main/java/com/example/progymhome/User/userData.json"); + for (UserDetail user : users) { + if (user.getUsername().equals(updatedUser.getUsername())) { + user.setName(updatedUser.getName()); + user.setDateOfBirth(updatedUser.getDateOfBirth()); + user.setWeight(updatedUser.getWeight()); + user.setHeight(updatedUser.getHeight()); + user.setWeightUnit(updatedUser.getWeightUnit()); + user.setHeightUnit(updatedUser.getHeightUnit()); + user.setAge(updatedUser.getAge()); + user.setUserListSession(updatedUser.getUserListSession()); + user.setPhoneNumber(updatedUser.getPhoneNumber()); + break; + } + } + saveToFile(fileName); + } + public UserDetail findUser(String userName) + { + loadFromFile("src/main/java/com/example/progymhome/User/userData.json"); + for (UserDetail user : users) + { + if(user.getUsername().equals(userName)) return user; + } + return null; + } public boolean checkUserOnList(String username, String password) { + loadFromFile("src/main/java/com/example/progymhome/User/userData.json"); for (UserDetail user : users) { if (user.getUsername().equals(username) && user.getPassword().equals(password)) { return true; @@ -31,4 +108,32 @@ public boolean checkUserOnList(String username, String password) { } return false; } + + + +// public void saveUserToFile(String fileName) { +// Gson gson = new GsonBuilder() +// .registerTypeAdapter(LocalDate.class, new LocalDateJson()) +// .create(); +// try (FileWriter writer = new FileWriter(fileName)) { +// // Lưu dữ liệu của userListSessions vào file +// gson.toJson(userListSessions, writer); +// System.out.println("Dữ liệu đã được lưu vào file " + fileName); +// } catch (IOException e) { +// e.printStackTrace(); +// } +// } +// public void loadUserFromFile(String fileName) { +// Gson gson = new GsonBuilder() +// .registerTypeAdapter(LocalDate.class, new LocalDateJson()) +// .create(); +// try (FileReader reader = new FileReader(fileName)) { +// // Đảm bảo rằng bạn đọc vào đối tượng UserListSession +// Type userListSessionType = new TypeToken(){}.getType(); +// userListSessions = gson.fromJson(reader, userListSessionType); +// System.out.println("Dữ liệu đã được tải từ file " + fileName); +// } catch (IOException e) { +// e.printStackTrace(); +// } +// } } diff --git a/ProGYMHOME/src/main/java/com/example/progymhome/User/UserSession.java b/ProGYMHOME/src/main/java/com/example/progymhome/User/UserSession.java new file mode 100644 index 0000000..b31a32f --- /dev/null +++ b/ProGYMHOME/src/main/java/com/example/progymhome/User/UserSession.java @@ -0,0 +1,53 @@ +package com.example.progymhome.User; + +public class UserSession { + private String namePratice; + private String detailPratice; + private Integer repLesson; + private Integer setLesson; + private Double time; + private static UserSession instance; + public UserSession() {} + public static UserSession getInstance() + { + if(instance == null) + { + instance = new UserSession(); + } + return instance; + } + public String getNamePratice() { + return namePratice; + } + + public void setNamePratice(String namePratice) { + this.namePratice = namePratice; + } + + public String getDetailPratice() { + return detailPratice; + } + + public void setDetailPratice(String detailPratice) { + this.detailPratice = detailPratice; + } + + public Double getTime() { + return time; + } + + public void setTime(Double time) { + this.time = time; + } + + public String[] splitString() { + if (detailPratice != null && detailPratice.matches(".*\\S+\\s*[xX]\\s*\\S+.*")) { + String[] parts = detailPratice.split("[xX]", 2); + parts[0] = parts[0].trim(); + parts[1] = parts[1].trim(); + return parts; + } else { + return new String[] { detailPratice }; + } + } +} diff --git a/ProGYMHOME/src/main/java/com/example/progymhome/User/userData.json b/ProGYMHOME/src/main/java/com/example/progymhome/User/userData.json new file mode 100644 index 0000000..247aac2 --- /dev/null +++ b/ProGYMHOME/src/main/java/com/example/progymhome/User/userData.json @@ -0,0 +1,39 @@ +[ + { + "name": "Phúc", + "username": "a", + "password": "a", + "dateOfBirth": "2020-03-05", + "height": 175.0, + "weight": 65.0, + "weightUnit": "KG", + "heightUnit": "Cm", + "age": 5, + "userListSession": { + "users": [ + { + "namePratice": "Bench Press", + "detailPratice": "10x3" + }, + { + "namePratice": "Dead Lift", + "detailPratice": "10x3" + } + ] + } + }, + { + "name": "Do Vu Hai Dang", + "username": "b", + "password": "b", + "dateOfBirth": "2010-03-04", + "height": 175.0, + "weight": 65.0, + "weightUnit": "KG", + "heightUnit": "Cm", + "age": 15, + "userListSession": { + "users": [] + } + } +] \ No newline at end of file diff --git a/ProGYMHOME/src/main/java/com/example/progymhome/User/userListSessions.json b/ProGYMHOME/src/main/java/com/example/progymhome/User/userListSessions.json new file mode 100644 index 0000000..ca91e3d --- /dev/null +++ b/ProGYMHOME/src/main/java/com/example/progymhome/User/userListSessions.json @@ -0,0 +1,20 @@ +{ + "users": [ + { + "namePratice": "Bench Press", + "detailPratice": "10x3" + }, + { + "namePratice": "Dead Lift", + "detailPratice": "10x3" + }, + { + "namePratice": "Shoulder Press", + "detailPratice": "10x3" + }, + { + "namePratice": "Tricep Curl", + "detailPratice": "10x3" + } + ] +} \ No newline at end of file diff --git a/ProGYMHOME/src/main/java/com/example/progymhome/UserProgressController.java b/ProGYMHOME/src/main/java/com/example/progymhome/UserProgressController.java new file mode 100644 index 0000000..78a2661 --- /dev/null +++ b/ProGYMHOME/src/main/java/com/example/progymhome/UserProgressController.java @@ -0,0 +1,145 @@ +package com.example.progymhome; + +import java.io.IOException; +import java.net.URL; +import java.util.ResourceBundle; + +import com.example.progymhome.Lesson.LessonImage; +import com.example.progymhome.User.UserDetail; +import com.example.progymhome.User.UserListSession; +import com.example.progymhome.User.UserManager; +import com.example.progymhome.User.UserSession; +import javafx.event.EventHandler; +import javafx.fxml.FXML; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.control.Label; +import javafx.scene.image.ImageView; +import javafx.scene.input.MouseEvent; +import javafx.scene.layout.HBox; +import javafx.scene.layout.VBox; +import javafx.scene.text.Font; +import javafx.scene.text.FontWeight; + +public class UserProgressController { + + @FXML + private ResourceBundle resources; + + @FXML + private URL location; + + @FXML + private Label Calories; + + @FXML + private Label numExercises; + + @FXML + private Label totalTime; + + @FXML + private VBox addSession; + + @FXML + private ImageView onClickBack; + + private UserSession userSession; + private UserListSession userListSession; + private UserManager userManager; + private String[] part; + private int totalExercise; + private double totalTimeSession = 0; + private UserDetail userDetail; + + @FXML + void initialize() { + userSession = userSession.getInstance(); + userManager = userManager.getInstance(); + userDetail = userManager.findUser(SignInController.userName); + userListSession = userDetail.getUserListSession(); +// for (UserSession user : userListSession.getUsers()) { +// System.out.println(user.getNamePratice() + " " + user.getDetailPratice()); +// } + populateLessons(); + numExercises.setText(totalExercise + " Exercises"); + totalTime.setText(String.format("%.2f Minutes", totalTimeSession += WorkoutController.time)); + onClickBack.setOnMouseClicked(new EventHandler() { + @Override + public void handle(MouseEvent mouseEvent) { + try { + SwitchScreenController.switchToScene1(mouseEvent, "profile-screen.fxml"); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + }); + + + } + + public void addLessonToVbox(String name, String set, String rep) { + HBox lessonPane = new HBox(); + lessonPane.setSpacing(10); + lessonPane.setPadding(new Insets(10)); + lessonPane.setStyle("-fx-background-color: lightgray; -fx-border-radius: 5px; -fx-background-radius: 5px;"); + + Label lessonLabel = new Label(name); + Label setLabel = new Label("Sets: " + set); + Label repLabel = new Label("Reps: " + rep); + String nameLabel = getImageVideo(name); + ImageView imageLesson = new ImageView(nameLabel); + imageLesson.setFitWidth(40); + imageLesson.setFitHeight(40); + imageLesson.setPreserveRatio(true); + + Font poppinsBold = Font.font("Poppins", FontWeight.BOLD, 14); + lessonLabel.setFont(poppinsBold); + setLabel.setFont(poppinsBold); + repLabel.setFont(poppinsBold); + + lessonPane.getChildren().addAll(imageLesson, lessonLabel, setLabel, repLabel); + lessonPane.setAlignment(Pos.CENTER_LEFT); + this.addSession.getChildren().add(lessonPane); + } + + public void populateLessons() { + + for (UserSession user : userListSession.getUsers()) { + ++totalExercise; + System.out.println(user.getNamePratice() + " " + user.getDetailPratice()); + userSession.setNamePratice(user.getNamePratice()); + userSession.setDetailPratice(user.getDetailPratice()); + userSession.setTime(user.getTime()); + System.out.println(user.getTime()); +// totalTimeSession += userSession.getTime(); + part = user.splitString(); + String name = user.getNamePratice(); + String set = "", rep = ""; + + if (part.length == 1) { + rep = part[0]; + } else { + set = part[1] + " Sets"; + rep = part[0] + " Reps"; + } + + + addLessonToVbox(name, set, rep); + } + } + + private String getImageVideo(String lessonName) { + for (LessonImage lesson : LessonImage.values()) { + String name = lessonName.replace(" ", "_").toUpperCase(); + System.out.println(name); + if (lesson.name().equals(name)) { + return lesson.getLinkImage(); + } else { + System.out.println("No machting found" + lessonName); + } + } + return lessonName; + } + +} diff --git a/ProGYMHOME/src/main/java/com/example/progymhome/WorkoutController.java b/ProGYMHOME/src/main/java/com/example/progymhome/WorkoutController.java new file mode 100644 index 0000000..b1a5d2c --- /dev/null +++ b/ProGYMHOME/src/main/java/com/example/progymhome/WorkoutController.java @@ -0,0 +1,210 @@ +package com.example.progymhome; + +import java.io.IOException; +import java.net.URL; +import java.util.ResourceBundle; + +import com.example.progymhome.Lesson.LessonLink; +import com.example.progymhome.Screen.ScreenBackManager; +import com.example.progymhome.User.UserListSession; +import com.example.progymhome.User.UserSession; +import javafx.event.EventHandler; +import javafx.fxml.FXML; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.image.Image; +import javafx.scene.image.ImageView; +import javafx.scene.input.MouseEvent; +import javafx.scene.layout.AnchorPane; +import javafx.scene.web.WebView; + +public class WorkoutController { + + @FXML + private ResourceBundle resources; + + @FXML + private URL location; + + @FXML + private Label nameLesson; + + @FXML + private ImageView onClickBack; + + @FXML + private ImageView onClickBack10s; + + @FXML + private Button onClickDone; + + @FXML + private ImageView onClickForward10s; + + @FXML + private ImageView onClickNext; + + @FXML + private ImageView onClickPlay; + + @FXML + private AnchorPane onPlayVideo; + + @FXML + private Label repLesson; + + @FXML + private Label setLesson; + + @FXML + private ImageView returnScreen; + + private WebView webView; + private boolean isPlaying = false; + private UserSession userSession; + private String[] part; + private String videoID; + private UserListSession userListSession; + public static double time; + public static boolean checkDone; + @FXML + void initialize() { + long startTime = System.currentTimeMillis(); + userSession = userSession.getInstance(); + userListSession = userListSession.getInstance(); + nameLesson.setText(userSession.getNamePratice()); + videoID = getVideoIDFromLesson(nameLesson.getText()); + System.out.println(videoID); + setUpWebView(videoID); + + + part = userSession.splitString(); + for (int i = 0 ; i < part.length ; ++i) + { + System.out.println(part[i]); + } + if (part.length == 1) { + repLesson.setText(part[0]); + } else { + setLesson.setText(part[1] + " sets"); + repLesson.setText(part[0] + " reps"); + } + + + onClickPlay.setOnMouseClicked(event -> { + if (!isPlaying) { + executeJS("playVideo()"); + onClickPlay.setImage(new Image(getClass().getResource("/img/pause.png").toExternalForm())); + isPlaying = true; + } else { + executeJS("pauseVideo()"); + onClickPlay.setImage(new Image(getClass().getResource("/img/play.png").toExternalForm())); + isPlaying = false; + } + }); + + onClickBack10s.setOnMouseClicked(event -> executeJS("rewindVideo()")); + onClickForward10s.setOnMouseClicked(event -> executeJS("forwardVideo()")); + + returnScreen.setOnMouseClicked(event -> { + try { + + executeJS("pauseVideo()"); + String backScreen = ScreenBackManager.popScreen(); + if(backScreen != null) + { + System.out.println(backScreen); + SwitchScreenController.switchToScene1(event, backScreen); + } + + + } catch (IOException e) { + throw new RuntimeException(e); + } + }); + onClickDone.setOnMouseClicked(new EventHandler() { + @Override + public void handle(MouseEvent mouseEvent) { + checkDone = false; + long endTime = System.currentTimeMillis(); + time = (endTime - startTime) /60000.0; + System.out.println(time); + checkDone = true; + + if(checkDone) + { + try { + executeJS("pauseVideo()"); + String backScreen = ScreenBackManager.popScreen(); + if(backScreen != null) + { + System.out.println(backScreen); + SwitchScreenController.switchToScene1(mouseEvent, backScreen); + } + + + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + } + }); + + + + } + + private void setUpWebView(String videoLink) { + webView = new WebView(); + webView.setPrefSize(onPlayVideo.getPrefWidth(), onPlayVideo.getPrefHeight()); + + String htmlContent = "" + + "" + + "" + + "" + + ""; + + webView.getEngine().loadContent(htmlContent, "text/html"); + onPlayVideo.getChildren().add(webView); + } + + + private void executeJS(String script) { + webView.getEngine().executeScript(script); + } + private String getVideoIDFromLesson(String lessonName) { + for (LessonLink lesson : LessonLink.values()) { + if (lesson.name().equalsIgnoreCase(lessonName.replace(" ", "_"))) { + return lesson.getVideoID(); + } + else if(lessonName.equals("Meditation")) + { + return LessonLink.MEDITATION.getVideoID(); + } + else if(lessonName.equals("Running") || lessonName.equals("Ride Bicycle") || lessonName.equals("Drink Water")) + { + return LessonLink.CHILLING.getVideoID(); + } + else if(lessonName.equals("Warm Up")) + { + return LessonLink.WARM_UP.getVideoID(); + } + } + return "defaultVideoID"; + } + +} diff --git a/ProGYMHOME/src/main/java/module-info.java b/ProGYMHOME/src/main/java/module-info.java index 4481574..f4972f4 100644 --- a/ProGYMHOME/src/main/java/module-info.java +++ b/ProGYMHOME/src/main/java/module-info.java @@ -1,14 +1,23 @@ module com.example.progymhome { requires javafx.controls; requires javafx.fxml; + requires javafx.web; + requires javafx.base; + requires javafx.graphics; + requires java.desktop; requires org.controlsfx.controls; requires com.dlsc.formsfx; requires net.synedra.validatorfx; requires org.kordamp.bootstrapfx.core; - requires java.desktop; + requires com.google.gson; opens com.example.progymhome to javafx.fxml; exports com.example.progymhome; -} \ No newline at end of file + opens com.example.exfxwebview to javafx.fxml; + exports com.example.exfxwebview; + exports com.example.progymhome.Screen; + opens com.example.progymhome.Screen to javafx.fxml; + opens com.example.progymhome.User to com.google.gson; +} diff --git a/ProGYMHOME/src/main/resources/com/example/progymhome/add-screen.fxml b/ProGYMHOME/src/main/resources/com/example/progymhome/add-screen.fxml new file mode 100644 index 0000000..3d5027a --- /dev/null +++ b/ProGYMHOME/src/main/resources/com/example/progymhome/add-screen.fxml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ProGYMHOME/src/main/resources/com/example/progymhome/customize-pratice.fxml b/ProGYMHOME/src/main/resources/com/example/progymhome/customize-pratice.fxml index 189f2da..8d05e1b 100644 --- a/ProGYMHOME/src/main/resources/com/example/progymhome/customize-pratice.fxml +++ b/ProGYMHOME/src/main/resources/com/example/progymhome/customize-pratice.fxml @@ -9,11 +9,11 @@ - + - + - - + @@ -64,7 +64,7 @@ - + @@ -78,7 +78,7 @@ - + @@ -92,7 +92,7 @@ - + @@ -106,7 +106,7 @@ - + @@ -136,16 +136,16 @@ - + - + - - + - - + - - + - - + - - + - - + - - + - + - - + - - + - - + - + - - + - - + - - + - + - - + - - + - - + - + - - + - - + - - + - + + + + + diff --git a/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-Black.ttf b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-Black.ttf new file mode 100644 index 0000000..71c0f99 Binary files /dev/null and b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-Black.ttf differ diff --git a/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-BlackItalic.ttf b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-BlackItalic.ttf new file mode 100644 index 0000000..7aeb58b Binary files /dev/null and b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-BlackItalic.ttf differ diff --git a/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-Bold.ttf b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-Bold.ttf new file mode 100644 index 0000000..00559ee Binary files /dev/null and b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-Bold.ttf differ diff --git a/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-BoldItalic.ttf b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-BoldItalic.ttf new file mode 100644 index 0000000..e61e8e8 Binary files /dev/null and b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-BoldItalic.ttf differ diff --git a/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-ExtraBold.ttf b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-ExtraBold.ttf new file mode 100644 index 0000000..df70936 Binary files /dev/null and b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-ExtraBold.ttf differ diff --git a/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-ExtraBoldItalic.ttf b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-ExtraBoldItalic.ttf new file mode 100644 index 0000000..14d2b37 Binary files /dev/null and b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-ExtraBoldItalic.ttf differ diff --git a/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-ExtraLight.ttf b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-ExtraLight.ttf new file mode 100644 index 0000000..e76ec69 Binary files /dev/null and b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-ExtraLight.ttf differ diff --git a/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-ExtraLightItalic.ttf b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-ExtraLightItalic.ttf new file mode 100644 index 0000000..89513d9 Binary files /dev/null and b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-ExtraLightItalic.ttf differ diff --git a/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-Italic.ttf b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-Italic.ttf new file mode 100644 index 0000000..12b7b3c Binary files /dev/null and b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-Italic.ttf differ diff --git a/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-Light.ttf b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-Light.ttf new file mode 100644 index 0000000..bc36bcc Binary files /dev/null and b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-Light.ttf differ diff --git a/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-LightItalic.ttf b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-LightItalic.ttf new file mode 100644 index 0000000..9e70be6 Binary files /dev/null and b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-LightItalic.ttf differ diff --git a/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-Medium.ttf b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-Medium.ttf new file mode 100644 index 0000000..6bcdcc2 Binary files /dev/null and b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-Medium.ttf differ diff --git a/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-MediumItalic.ttf b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-MediumItalic.ttf new file mode 100644 index 0000000..be67410 Binary files /dev/null and b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-MediumItalic.ttf differ diff --git a/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-Regular.ttf b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-Regular.ttf new file mode 100644 index 0000000..9f0c71b Binary files /dev/null and b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-Regular.ttf differ diff --git a/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-SemiBold.ttf b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-SemiBold.ttf new file mode 100644 index 0000000..74c726e Binary files /dev/null and b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-SemiBold.ttf differ diff --git a/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-SemiBoldItalic.ttf b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-SemiBoldItalic.ttf new file mode 100644 index 0000000..3e6c942 Binary files /dev/null and b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-SemiBoldItalic.ttf differ diff --git a/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-Thin.ttf b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-Thin.ttf new file mode 100644 index 0000000..03e7366 Binary files /dev/null and b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-Thin.ttf differ diff --git a/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-ThinItalic.ttf b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-ThinItalic.ttf new file mode 100644 index 0000000..e26db5d Binary files /dev/null and b/ProGYMHOME/src/main/resources/com/example/progymhome/fonts/Poppins-ThinItalic.ttf differ diff --git a/ProGYMHOME/src/main/resources/com/example/progymhome/pratice-screen.fxml b/ProGYMHOME/src/main/resources/com/example/progymhome/pratice-screen.fxml index 09ff76b..9dceb68 100644 --- a/ProGYMHOME/src/main/resources/com/example/progymhome/pratice-screen.fxml +++ b/ProGYMHOME/src/main/resources/com/example/progymhome/pratice-screen.fxml @@ -133,7 +133,7 @@ - @@ -166,8 +166,8 @@ - @@ -182,8 +182,8 @@ - @@ -198,11 +198,11 @@ - - diff --git a/ProGYMHOME/src/main/resources/com/example/progymhome/user-progress-screen.fxml b/ProGYMHOME/src/main/resources/com/example/progymhome/user-progress-screen.fxml new file mode 100644 index 0000000..3031c0f --- /dev/null +++ b/ProGYMHOME/src/main/resources/com/example/progymhome/user-progress-screen.fxml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ProGYMHOME/src/main/resources/com/example/progymhome/workout-video-screen.fxml b/ProGYMHOME/src/main/resources/com/example/progymhome/workout-video-screen.fxml index 7145f05..439c6b4 100644 --- a/ProGYMHOME/src/main/resources/com/example/progymhome/workout-video-screen.fxml +++ b/ProGYMHOME/src/main/resources/com/example/progymhome/workout-video-screen.fxml @@ -7,58 +7,62 @@ - - + - + - + + + + + diff --git a/ProGYMHOME/src/main/resources/img/Smart Fitness.png b/ProGYMHOME/src/main/resources/img/Smart Fitness.png new file mode 100644 index 0000000..ab36c94 Binary files /dev/null and b/ProGYMHOME/src/main/resources/img/Smart Fitness.png differ diff --git a/ProGYMHOME/src/main/resources/img/hide.png b/ProGYMHOME/src/main/resources/img/hide.png new file mode 100644 index 0000000..62dc80a Binary files /dev/null and b/ProGYMHOME/src/main/resources/img/hide.png differ diff --git a/ProGYMHOME/src/main/resources/img/logout.png b/ProGYMHOME/src/main/resources/img/logout.png new file mode 100644 index 0000000..a7cb39c Binary files /dev/null and b/ProGYMHOME/src/main/resources/img/logout.png differ diff --git a/ProGYMHOME/src/main/resources/img/show.png b/ProGYMHOME/src/main/resources/img/show.png new file mode 100644 index 0000000..a659b82 Binary files /dev/null and b/ProGYMHOME/src/main/resources/img/show.png differ diff --git a/ProGYMHOME/src/main/resources/img/subtracting-button.png b/ProGYMHOME/src/main/resources/img/subtracting-button.png new file mode 100644 index 0000000..e6aa153 Binary files /dev/null and b/ProGYMHOME/src/main/resources/img/subtracting-button.png differ diff --git a/ProGYMHOME/userData.json b/ProGYMHOME/userData.json new file mode 100644 index 0000000..3b0395a --- /dev/null +++ b/ProGYMHOME/userData.json @@ -0,0 +1 @@ +[{"username":"a","password":"a"}] \ No newline at end of file