5
5
import entities .chat .PrivateChatfactory ;
6
6
import interface_adapters .appscreen .AppScreenPresenter ;
7
7
import interface_adapters .appscreen .Refresh ;
8
+ import screens .Profile_screen .UserSearchUI ;
8
9
import screens .chat_screen .ChatController ;
9
10
import screens .chat_screen .ChatView ;
11
+ import screens .profile_update_screen .UserModificationUI ;
10
12
import use_cases .appscreen .*;
11
13
import use_cases .chat_initiation_use_case .ChatInputBoundry ;
12
14
import use_cases .chat_initiation_use_case .ChatInteractor ;
@@ -26,8 +28,8 @@ public class AppScreen implements AppScreenPresenter, Refresh {
26
28
27
29
/**
28
30
Create an AppScreen object
29
- @param chats This is a list of chats given by the user (the list will always come as sorted with the
30
- most recent chats at the end of the list)
31
+ @param chats This is a list o most recent chats at the end of the list)
32
+ f chats given by the user ( the list will always come as sorted with the
31
33
*/
32
34
public AppScreen (String currentUsername , ArrayList <Chat > chats ) {
33
35
this .currentUsername = currentUsername ;
@@ -47,6 +49,24 @@ public AppScreen(String currentUsername, ArrayList<Chat> chats) {
47
49
addPrivateChat .setPreferredSize (new Dimension (40 , 30 ));
48
50
addGroupChat .setPreferredSize (new Dimension (40 , 30 ));
49
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
+
50
70
// adding the action listeners for the +private-chat and +group-chat buttons
51
71
addPrivateChat .addActionListener (e -> {
52
72
PrivateChatfactory privateChatfactory = new CommonPrivatechat ();
@@ -64,7 +84,10 @@ public AppScreen(String currentUsername, ArrayList<Chat> chats) {
64
84
65
85
topPanel .add (addPrivateChat );
66
86
topPanel .add (addGroupChat );
87
+ menuPanel .add (searchUsers );
88
+ menuPanel .add (profileSettings );
67
89
jFrame .add (topPanel , BorderLayout .NORTH );
90
+ jFrame .add (menuPanel , BorderLayout .SOUTH );
68
91
69
92
this .chats = chats ;
70
93
openScreen ();
0 commit comments