File tree Expand file tree Collapse file tree 2 files changed +37
-44
lines changed
src/main/java/chatlinitation Expand file tree Collapse file tree 2 files changed +37
-44
lines changed Original file line number Diff line number Diff line change
1
+ package chatlinitation ;
2
+
3
+
4
+
5
+ import entities .PrivateChat ;
6
+
7
+ /**
8
+ * Chatinteractor connects our ChatView UI to our Entities.
9
+ * It provide data to the view, so that view can put that data on the screen.
10
+ * this class contain Privatchat and methods to update the Private chat.
11
+ */
12
+
13
+ public class ChatInteractor {
14
+
15
+ PrivateChat privatechat ;
16
+
17
+
18
+ // constructor containing the private chat
19
+ public ChatInteractor (PrivateChat privatechat ) {
20
+ this .privatechat = privatechat ;
21
+ }
22
+
23
+
24
+ //Update the Recipientusername when the user type in the username text field and click add button.
25
+ public void setRecipientUsername (String recipientUsername ) {
26
+ this .privatechat .setRecipientUsername (recipientUsername ) ;
27
+ }
28
+
29
+
30
+ // Update the message history when the type in put in message txtfieled and click send button.
31
+ public void setMessage (String content ) {
32
+ MsgFactory msgfactory = new MsgFactory ("text" );
33
+ privatechat .addtoconvHist (msgfactory .createMsg (privatechat .getSendertUsername (), content ));
34
+ }
35
+
36
+
37
+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments