Skip to content

Commit fd6f978

Browse files
committed
Package structure implemented
1 parent bdce5a1 commit fd6f978

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

src/main/java/User.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import user_attribute_modification_use_case.Changeable;
2+
13
import java.io.Serializable;
2-
public abstract class User implements Serializable, Changeable{
4+
public abstract class User implements Serializable, Changeable {
35
protected String username;
46
protected String password;
57
protected String email;
@@ -25,7 +27,7 @@ public Boolean PasswordMatch(String attempt){
2527
}
2628

2729
@Override
28-
// from Changeable
30+
// from user_attribute_modification_use_case.Changeable
2931
public void changeFeature(String feature, String newFeature){
3032
if (feature == "Username"){
3133
this.username = newFeature;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package profile_modification_IA;
2+
13
public interface ChangeController {
24
public boolean reportChange(String username, String password, String feature, String newFeature);
35
}

src/main/java/UserModificationUI.java renamed to src/main/java/profile_update_screen/UserModificationUI.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
/**
1+
package profile_update_screen; /**
22
* Provides the UI elements
33
*/
4+
import profile_modification_IA.ChangeController;
5+
46
import javax.swing.*;
57
import java.awt.*;
68
import java.awt.event.ActionEvent;
79
import java.awt.event.ActionListener;
810

9-
public class UserModificationUI implements ChangeController{
11+
public class UserModificationUI implements ChangeController {
1012
private JLabel label;
1113
public UserModificationUI() {
1214
final JFrame frame = new JFrame();
@@ -70,7 +72,7 @@ public void actionPerformed(ActionEvent e) {
7072
frame.setVisible(true);
7173
}
7274

73-
// ChangeController makes UI implement reportChange to invert the use-case --> UI dependency
75+
// profile_modification_IA.ChangeController makes UI implement reportChange to invert the use-case --> UI dependency
7476
@Override
7577
public boolean reportChange(String username, String password, String feature, String newFeature) {
7678
UserDatabase db = new UserDatabase();
@@ -88,7 +90,7 @@ public boolean reportChange(String username, String password, String feature, St
8890

8991
// for trying out the code:
9092
// public static void main(String[] args) {
91-
// new UserModificationUI();
93+
// new profile_update_screen.UserModificationUI();
9294
//
9395
// }
9496

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package user_attribute_modification_use_case;
2+
13
public interface Changeable {
24
public void changeFeature(String feature, String newFeature);
35
}

src/test/java/TestUserChange.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import org.junit.jupiter.api.Assertions;
2-
3-
import java.io.File;
2+
import profile_update_screen.UserModificationUI;
43

54
public class TestUserChange {
65
public void correctChange() {

0 commit comments

Comments
 (0)