From 0b5da58ffe949c863bbee552692f7fecea6f8749 Mon Sep 17 00:00:00 2001 From: JANMAY007 Date: Mon, 20 Nov 2023 18:26:54 -0700 Subject: [PATCH 1/3] Backlog management for Developer and Product Owner --- .idea/misc.xml | 1 - .idea/modules.xml | 8 --- .idea/vcs.xml | 2 +- .../SER/classes/BacklogManagementSystem.java | 51 +++++++++++++++++++ 4 files changed, 52 insertions(+), 10 deletions(-) delete mode 100644 .idea/modules.xml create mode 100644 src/main/java/org/SER/classes/BacklogManagementSystem.java diff --git a/.idea/misc.xml b/.idea/misc.xml index d1bdc15..5f55110 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,3 @@ - diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index d7185f9..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 94a25f7..35eb1dd 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/src/main/java/org/SER/classes/BacklogManagementSystem.java b/src/main/java/org/SER/classes/BacklogManagementSystem.java new file mode 100644 index 0000000..962bc5e --- /dev/null +++ b/src/main/java/org/SER/classes/BacklogManagementSystem.java @@ -0,0 +1,51 @@ +package org.SER.classes; + +public class BacklogManagementSystem { + + private final SprintBacklog sprintBacklog; + private final ProductBacklog productBacklog; + + public BacklogManagementSystem(SprintBacklog sprintBacklog, ProductBacklog productBacklog) { + this.sprintBacklog = sprintBacklog; + this.productBacklog = productBacklog; + } + + public void manageBacklog(User user) { + UserType userType = user.getUserType(); + + if (userType == UserType.DEVELOPER) { + // Developer can view and update Sprint Backlog + System.out.println("Developer Access:"); + System.out.println("Sprint Backlog: " + sprintBacklog.getsprintBacklog()); + + // Example: Update status of a User Story in Sprint Backlog + int userStoryIdToUpdate = 1; // Replace with the actual User Story ID + Status newStatus = Status.IN_PROGRESS; + sprintBacklog.updateStatus(userStoryIdToUpdate, newStatus); + + // Example: Remove a User Story from Sprint Backlog + int userStoryIdToRemove = 2; // Replace with the actual User Story ID + sprintBacklog.removeUserStory(userStoryIdToRemove); + + // You can add more functionality specific to developers here + } else if (userType == UserType.PRODUCT_OWNER) { + // Product Owner can view and update Product Backlog + System.out.println("Product Owner Access:"); + System.out.println("Product Backlog: " + productBacklog.getProductBacklog()); + + // Example: Update priority of a User Story in Product Backlog + int userStoryIdToUpdate = 1; // Replace with the actual User Story ID + int newPriority = 2; // Replace with the new priority + productBacklog.updatePriority(userStoryIdToUpdate, newPriority); + + // Example: Remove a User Story from Product Backlog + int userStoryIdToRemove = 3; // Replace with the actual User Story ID + productBacklog.removeUserStory(userStoryIdToRemove); + + // You can add more functionality specific to product owners here + } else { + // Handle other user types or provide a default behavior + System.out.println("Invalid user type or access not granted."); + } + } +} From 6c6b1a29e619bb3f8061351cbb62b22be0f2b407 Mon Sep 17 00:00:00 2001 From: JANMAY007 Date: Wed, 29 Nov 2023 16:00:03 -0700 Subject: [PATCH 2/3] Updated backlog management with necessary comments --- .../SER/classes/BacklogManagementSystem.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/SER/classes/BacklogManagementSystem.java b/src/main/java/org/SER/classes/BacklogManagementSystem.java index 962bc5e..0234f5d 100644 --- a/src/main/java/org/SER/classes/BacklogManagementSystem.java +++ b/src/main/java/org/SER/classes/BacklogManagementSystem.java @@ -10,7 +10,7 @@ public BacklogManagementSystem(SprintBacklog sprintBacklog, ProductBacklog produ this.productBacklog = productBacklog; } - public void manageBacklog(User user) { + public void manageBacklog(User user, UserStory userStory) { UserType userType = user.getUserType(); if (userType == UserType.DEVELOPER) { @@ -19,27 +19,28 @@ public void manageBacklog(User user) { System.out.println("Sprint Backlog: " + sprintBacklog.getsprintBacklog()); // Example: Update status of a User Story in Sprint Backlog - int userStoryIdToUpdate = 1; // Replace with the actual User Story ID + int userStoryIdToUpdate = userStory.getId(); Status newStatus = Status.IN_PROGRESS; sprintBacklog.updateStatus(userStoryIdToUpdate, newStatus); // Example: Remove a User Story from Sprint Backlog - int userStoryIdToRemove = 2; // Replace with the actual User Story ID + int userStoryIdToRemove = userStory.getId(); sprintBacklog.removeUserStory(userStoryIdToRemove); // You can add more functionality specific to developers here } else if (userType == UserType.PRODUCT_OWNER) { // Product Owner can view and update Product Backlog System.out.println("Product Owner Access:"); - System.out.println("Product Backlog: " + productBacklog.getProductBacklog()); + // System.out.println("Product Backlog: " + productBacklog.getProductBacklog()); // Example: Update priority of a User Story in Product Backlog - int userStoryIdToUpdate = 1; // Replace with the actual User Story ID - int newPriority = 2; // Replace with the new priority - productBacklog.updatePriority(userStoryIdToUpdate, newPriority); + // add priority params if required + // int userStoryIdToUpdate = userStory.getId(); + // int newPriority = priority; + // productBacklog.updatePriority(userStoryIdToUpdate, newPriority); // Example: Remove a User Story from Product Backlog - int userStoryIdToRemove = 3; // Replace with the actual User Story ID + int userStoryIdToRemove = userStory.getId(); // Replace with the actual User Story ID productBacklog.removeUserStory(userStoryIdToRemove); // You can add more functionality specific to product owners here From 0a20818b4ec67fd49c1c33dc0f2c1cef1ec35d62 Mon Sep 17 00:00:00 2001 From: JANMAY007 Date: Wed, 29 Nov 2023 16:11:26 -0700 Subject: [PATCH 3/3] Sprint Progress Bar in new JFrame --- .../org/SER/classes/SprintProgressBar.java | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/main/java/org/SER/classes/SprintProgressBar.java diff --git a/src/main/java/org/SER/classes/SprintProgressBar.java b/src/main/java/org/SER/classes/SprintProgressBar.java new file mode 100644 index 0000000..fc29128 --- /dev/null +++ b/src/main/java/org/SER/classes/SprintProgressBar.java @@ -0,0 +1,53 @@ +package org.SER.classes; + +import javax.swing.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + + +public class SprintProgressBar extends JFrame { + + private final SprintBacklog sprintBacklog; + private final JProgressBar progressBar; + + public SprintProgressBar(SprintBacklog sprintBacklog) { + this.sprintBacklog = sprintBacklog; + + // New JFrame is created, if ot required remove the code of new JFrame and integrate remaining code + // Create a frame + JFrame frame = new JFrame("Sprint Progress Bar"); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setSize(300, 100); + + // Create a progress bar + progressBar = new JProgressBar(0, 100); + progressBar.setStringPainted(true); + + // Create a button to update progress + JButton updateButton = new JButton("Update Progress"); + updateButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + updateProgressBar(); + } + }); + + // Create a panel and add components + JPanel panel = new JPanel(); + panel.add(progressBar); + panel.add(updateButton); + + // Add panel to the frame + frame.add(panel); + + // Set frame visibility + frame.setVisible(true); + } + + // Method to update the progress bar based on the SprintBacklog progress + private void updateProgressBar() { + int progress = sprintBacklog.getProgress(); + progressBar.setValue(progress); + progressBar.setString("Progress: " + progress + "%"); + } +}