(String msg, int type)
| 240 | } |
| 241 | |
| 242 | public void sendMsg(String msg, int type) { |
| 243 | try { |
| 244 | if (type != 3) { |
| 245 | callback.sendMsg(this.friend.id, msg, type); |
| 246 | } |
| 247 | this.chattingPanel.addSent(msg, type); |
| 248 | if (type == 1) { |
| 249 | chattingRecords.add(new ChattingRecord(callback.id, "", msg, (byte) 0)); |
| 250 | } else { |
| 251 | if (type == 2) { |
| 252 | chattingRecords.add(new ChattingRecord(callback.id, "", msg, (byte) 2)); |
| 253 | } else if (type == 3) { |
| 254 | chattingRecords.add(new ChattingRecord(callback.id, "", msg, (byte) 4)); |
| 255 | } |
| 256 | } |
| 257 | } catch (Exception e) { |
| 258 | e.printStackTrace(); |
| 259 | } |
| 260 | jScrollPane.getViewport().setViewPosition(new Point(0, jScrollPane.getVerticalScrollBar().getMaximum())); |
| 261 | } |
| 262 | |
| 263 | public void receiveMsg(String msg, int type) { |
| 264 | this.chattingPanel.addReceived(msg, type); |
no test coverage detected