public void getFriendMessage( String lccno, final String msg, final FontStyle fontStyle, final Date sendDate, final Map<String, String> imgs) throws Exception { MessageFrame msgFrame = getMessageFrame(); final MemberBean memberBean = TreeUtil.getMemberBeanByLccno(lccno); if (memberBean == null) { RightCornerPopMessageManager.showDefaultRightCornerPopMessage(lccno + "用户已被删除,他的离线信息无法显示"); return; } final FriendChatPanel panel = getFriendChatPanel(memberBean); if (!SwingUtilities.isEventDispatchThread()) { SwingUtilities.invokeAndWait( new Runnable() { @Override public void run() { try { handleFriendMsg(panel, memberBean, msg, fontStyle, sendDate, imgs); } catch (Exception e) { log.error("insertFriendMsg", e); showErrorDialog("error", e.getMessage()); } } }); } else { handleFriendMsg(panel, memberBean, msg, fontStyle, sendDate, imgs); } if (!msgFrame.isVisible()) { msgFrame.setVisible(true); } }
public void transferInterrupt(String lccno, String streamID, String fileName) throws Exception { MemberBean memberBean = TreeUtil.getMemberBeanByLccno(lccno); final FriendChatPanel panel = getFriendChatPanel(memberBean); String info = StringUtil.getFormatString(getUIString("sendFile.interrupt"), fileName); long systemTime = Vovo.getLcmUtil().getSystemTime(); panel.otherCancelSendFile(streamID, new Date(systemTime), info); DataUtil.removeFileTransfer(streamID); }
public void recSendFileMsg(String lccno, String fileName, long fileSize, String streamID) { MessageFrame msgFrame = getMessageFrame(); MemberBean memberBean = TreeUtil.getMemberBeanByLccno(lccno); final FriendChatPanel panel = getFriendChatPanel(memberBean); panel.addRecvFileItem(fileName, fileSize, streamID); msgFrame.setVisible(true); msgFrame.setExtendedState(javax.swing.JFrame.NORMAL); // FlashWindowUtil.start(msgFrame); }
public void sendOfflineMessageFail(String lccno) { final MemberBean memberBean = TreeUtil.getMemberBeanByLccno(lccno); SwingUtilities.invokeLater( new Runnable() { public void run() { ChatController.this.showMessageDialog( null, VovoStringUtil.getFormatString( VovoStringUtil.getUIString("sendofflinemessage.fail.tip"), memberBean.getRealName())); } }); }
public void getOtherMsg(String lccno, String operate, Message msg) throws Exception { if (Constants.OTHERMSG_OPERATE_CANCELSENDFILE.equals(operate)) { String streamID = (String) msg.getProperty("streamID"); Date sendDate = new Date((Long) msg.getProperty("sendDate")); FileTransferRequest req = DataUtil.getFileTransferRequest(streamID); MessageFrame msgFrame = getMessageFrame(); MemberBean memberBean = TreeUtil.getMemberBeanByLccno(lccno); final FriendChatPanel panel = getFriendChatPanel(memberBean); String info = StringUtil.getFormatString( getUIString("sendFile.otherCancel"), "\"" + req.getFileName() + "\""); panel.otherCancelSendFile(streamID, sendDate, info); msgFrame.setVisible(true); } }
public boolean canRemovePanel(String[] sessionIDs) { boolean flag = true; for (String sessionID : sessionIDs) { if (!sessionID.startsWith(Constants.FRIEND_CHAT_SESSION_PREFIX)) { continue; } int memberId = Integer.parseInt(sessionID.split("_")[1]); String lccno = TreeUtil.getMemberNodeById(memberId).getInfo().getMember().getLccAccount(); boolean temp = LCCUtil.getInstance().existCall(lccno); if (temp) { this.showMessageDialog(getUIString("info.tip"), getUIString("phone.cannotClosePanel")); flag = false; break; } } return flag; }
public void sendFileComplete(String lccno, String streamID, String fileName) throws Exception { MemberBean memberBean = TreeUtil.getMemberBeanByLccno(lccno); final FriendChatPanel panel = getFriendChatPanel(memberBean); panel.sendFileComplete(streamID, fileName); DataUtil.removeFileTransfer(streamID); }
public void updateFileProcess(String lccno, String streamID, int percent) { MemberBean memberBean = TreeUtil.getMemberBeanByLccno(lccno); final FriendChatPanel panel = getFriendChatPanel(memberBean); panel.updateInfo(streamID, percent); }