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..0234f5d --- /dev/null +++ b/src/main/java/org/SER/classes/BacklogManagementSystem.java @@ -0,0 +1,52 @@ +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, UserStory userStory) { + 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 = userStory.getId(); + Status newStatus = Status.IN_PROGRESS; + sprintBacklog.updateStatus(userStoryIdToUpdate, newStatus); + + // Example: Remove a User Story from Sprint Backlog + 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()); + + // Example: Update priority of a User Story in Product Backlog + // 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 = userStory.getId(); // 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."); + } + } +} 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 + "%"); + } +}