Skip to content

Commit

Permalink
refactoring and javadocs
Browse files Browse the repository at this point in the history
- added sub packages to usecases package, updated some javadocs
  • Loading branch information
JasmineChu committed Aug 11, 2023
1 parent 096bcef commit 52608a3
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/main/java/drivers/CreateEmployeePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import java.awt.event.ActionListener;

/**
* ShiftChangeScreen.java
* Class for the JPanel ShiftChangeScreen, contains a TabbedPane for each panel to add or remove an employee.
* CreateEmployeePanel.java
* Class for the JPanel CreateEmployeePanel, prompts the user for input to create a new Employee in the HRSystem.
*/
public class CreateEmployeePanel extends JPanel implements ActionListener {

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/drivers/DeleteEmployeePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import java.util.ArrayList;

/**
* ShiftChangeScreen.java
* Class for the JPanel ShiftChangeScreen, contains a TabbedPane for each panel to add or remove an employee.
* DeleteEmployeePanel.java
* Class for the JPanel DeleteEmployeePanel, prompts the user for the ID of an Employee to delete from the HRSystem.
*/
public class DeleteEmployeePanel extends JPanel implements ActionListener {

Expand Down
8 changes: 5 additions & 3 deletions src/main/java/drivers/SchedulePanel.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package drivers;

import interfaceadapters.ScheduleController;
import usecases.DeleteEmployee;

import javax.swing.*;
import java.awt.*;
Expand Down Expand Up @@ -100,8 +99,11 @@ public static void deleteNewFrame(){

/**
* actionPerformed
* Calls callFileWriter() from ScheduleController with SchedulePanel's current data.
* @param e, ActionEvent from pressing JButton saveButton.
* Calls the appropriate action depending on JButton pressed.
* saveButton pressed: Attempts to write schedule data to .csv file.
* createEmployee pressed: JPanel to prompt user to create a new employee is opened.
* deleteEmployee pressed: JPanel to prompt user to delete an existing employee is opened.
* @param e, ActionEvent from pressing JButton saveButton, createEmployee or deleteEmployee.
*/
@Override
public void actionPerformed(ActionEvent e) {
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/interfaceadapters/ScheduleController.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@
import entities.HRSystem;
import entities.Schedule;
import entities.Shift;
import usecases.*;
import usecases.modifyemployees.CreateEmployee;
import usecases.modifyemployees.DeleteEmployee;
import usecases.modifyfiles.ScheduleDataParser;
import usecases.modifyfiles.ScheduleFileReader;
import usecases.modifyfiles.ScheduleFileWriter;
import usecases.modifyschedule.AddEmployee;
import usecases.modifyschedule.CreateSchedule;
import usecases.modifyschedule.RemoveEmployee;

import java.io.IOException;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package usecases;
package usecases.modifyemployees;

public interface CreateEmployee {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package usecases;
package usecases.modifyemployees;

public interface DeleteEmployee {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package usecases;
package usecases.modifyfiles;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package usecases;
package usecases.modifyfiles;

import java.io.BufferedReader;
import java.io.FileReader;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package usecases;
package usecases.modifyfiles;

import java.io.FileWriter;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package usecases;
package usecases.modifyschedule;

import entities.Schedule;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package usecases;
package usecases.modifyschedule;

import entities.Schedule;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package usecases;
package usecases.modifyschedule;

import entities.Schedule;

Expand Down

0 comments on commit 52608a3

Please sign in to comment.