Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

2 changes: 1 addition & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions src/main/java/org/SER/classes/BacklogManagementSystem.java
Original file line number Diff line number Diff line change
@@ -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.");
}
}
}
53 changes: 53 additions & 0 deletions src/main/java/org/SER/classes/SprintProgressBar.java
Original file line number Diff line number Diff line change
@@ -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 + "%");
}
}