Skip to content

Commit acb41d8

Browse files
committed
Accidentally removed user search buttons at the bottom of the frame; added them back
1 parent d0bc75a commit acb41d8

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

src/main/java/screens/appscreen/AppScreen.java

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
import entities.chat.Chat;
44
import entities.chat.CommonPrivatechat;
55
import entities.chat.PrivateChatfactory;
6-
import interface_adapters.appscreen.AppScreenController;
76
import interface_adapters.appscreen.AppScreenPresenter;
8-
import interface_adapters.appscreen.Refresh;
7+
import screens.Profile_screen.UserSearchUI;
98
import screens.chat_screen.ChatController;
109
import screens.chat_screen.ChatView;
10+
import screens.profile_update_screen.UserModificationUI;
1111
import use_cases.appscreen.*;
1212
import use_cases.chat_initiation_use_case.ChatInputBoundry;
1313
import use_cases.chat_initiation_use_case.ChatInteractor;
@@ -48,15 +48,35 @@ public AppScreen(String currentUsername, ArrayList<Chat> chats) {
4848
addPrivateChat.setPreferredSize(new Dimension(40, 30));
4949
addGroupChat.setPreferredSize(new Dimension(40, 30));
5050

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+
5171
// adding the action listeners for the +private-chat and +group-chat buttons
5272
addPrivateChat.addActionListener(e -> {
5373
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);
5676
new ChatView(controller, true);
5777

5878
});
59-
//TODO: add groupchat action
79+
//TODO: add group chat action
6080
// addGroupChat.addActionListener(e -> {
6181
// ChatView newChat = new ChatView(currentUsername, true);
6282
// newChat.chatDisplay();
@@ -65,7 +85,10 @@ public AppScreen(String currentUsername, ArrayList<Chat> chats) {
6585

6686
topPanel.add(addPrivateChat);
6787
topPanel.add(addGroupChat);
88+
menuPanel.add(searchUsers);
89+
menuPanel.add(profileSettings);
6890
jFrame.add(topPanel, BorderLayout.NORTH);
91+
jFrame.add(menuPanel, BorderLayout.SOUTH);
6992

7093
this.chats = chats;
7194
openScreen();

0 commit comments

Comments
 (0)