Exemplo n.º 1
0
  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);
    }
  }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 public void showFriendChat(MemberBean bean) {
   MessageFrame msgFrame = getMessageFrame();
   getFriendChatPanel(bean);
   String key = Constants.FRIEND_CHAT_SESSION_PREFIX + bean.getLccAccount();
   ControllerEvent event = new ControllerEvent();
   event.setExClass("chat");
   event.setExMethod("showNotReadMessage");
   event.setParas(new Object[] {key});
   MyTrayIcon trayIcon = context.getViewManager().getView(Constants.ViewKey.TRAYICON.toString());
   trayIcon.removeEvent(event);
   showNotReadMessage(key);
   msgFrame.setExtendedState(JFrame.NORMAL);
   msgFrame.setVisible(true);
 }
Exemplo n.º 4
0
 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);
   }
 }