3
3
import entities .chat .Chat ;
4
4
import entities .chat .CommonPrivatechat ;
5
5
import entities .chat .PrivateChatfactory ;
6
- import interface_adapters .appscreen .AppScreenController ;
7
6
import interface_adapters .appscreen .AppScreenPresenter ;
8
- import interface_adapters . appscreen . Refresh ;
7
+ import screens . Profile_screen . UserSearchUI ;
9
8
import screens .chat_screen .ChatController ;
10
9
import screens .chat_screen .ChatView ;
10
+ import screens .profile_update_screen .UserModificationUI ;
11
11
import use_cases .appscreen .*;
12
12
import use_cases .chat_initiation_use_case .ChatInputBoundry ;
13
13
import use_cases .chat_initiation_use_case .ChatInteractor ;
@@ -48,15 +48,35 @@ public AppScreen(String currentUsername, ArrayList<Chat> chats) {
48
48
addPrivateChat .setPreferredSize (new Dimension (40 , 30 ));
49
49
addGroupChat .setPreferredSize (new Dimension (40 , 30 ));
50
50
51
+
52
+ // menu panel containing the buttons for searching for users or accessing profile settings
53
+ JPanel menuPanel = new JPanel ();
54
+ menuPanel .setLayout (new GridLayout (1 ,2 ));
55
+
56
+ JButton searchUsers = new JButton ("Search Users" );
57
+ JButton profileSettings = new JButton ("Profile Settings" );
58
+
59
+ searchUsers .setPreferredSize (new Dimension (40 , 30 ));
60
+ profileSettings .setPreferredSize (new Dimension (30 , 30 ));
61
+
62
+
63
+ // adding the action listeners for the Search Users button
64
+ searchUsers .addActionListener (e -> new UserSearchUI ());
65
+
66
+ // adding the action listeners for the Profile Settings button
67
+ profileSettings .addActionListener (e -> new UserModificationUI ());
68
+
69
+
70
+
51
71
// adding the action listeners for the +private-chat and +group-chat buttons
52
72
addPrivateChat .addActionListener (e -> {
53
73
PrivateChatfactory privateChatfactory = new CommonPrivatechat ();
54
- ChatInputBoundry inputBoundry = new ChatInteractor (privateChatfactory );
55
- ChatController controller = new ChatController (inputBoundry , currentUsername );
74
+ ChatInputBoundry inputBoundary = new ChatInteractor (privateChatfactory );
75
+ ChatController controller = new ChatController (inputBoundary , currentUsername );
56
76
new ChatView (controller , true );
57
77
58
78
});
59
- //TODO: add groupchat action
79
+ //TODO: add group chat action
60
80
// addGroupChat.addActionListener(e -> {
61
81
// ChatView newChat = new ChatView(currentUsername, true);
62
82
// newChat.chatDisplay();
@@ -65,7 +85,10 @@ public AppScreen(String currentUsername, ArrayList<Chat> chats) {
65
85
66
86
topPanel .add (addPrivateChat );
67
87
topPanel .add (addGroupChat );
88
+ menuPanel .add (searchUsers );
89
+ menuPanel .add (profileSettings );
68
90
jFrame .add (topPanel , BorderLayout .NORTH );
91
+ jFrame .add (menuPanel , BorderLayout .SOUTH );
69
92
70
93
this .chats = chats ;
71
94
openScreen ();
0 commit comments