Beispiel #1
0
 public MessageFrame getMessageFrame() {
   try {
     MessageFrame view =
         Vovo.getViewManager().getView(Constants.ViewKey.MESSAGEFRAME.toString()); //
     if (view == null) {
       view =
           Vovo.getViewManager()
               .createView(MessageFrame.class, Constants.ViewKey.MESSAGEFRAME.toString());
       MessageTabPanel createView =
           Vovo.getViewManager()
               .createView(MessageTabPanel.class, Constants.ViewKey.MESSAGETABPANEL.toString());
       view.add(createView);
       LoginInfo loginInfo =
           Vovo.getMyContext().getDataManager().getValue(Constants.DataKey.LOGGININFO.toString());
       //				UserInfoUtil.setProperty("", value)
       String tabPlacement = UserInfoUtil.getProperty(loginInfo.getUsername(), "TabPlacement");
       if (tabPlacement == null || tabPlacement.equals("")) {
         tabPlacement = "2";
         UserInfoUtil.setProperty(loginInfo.getUsername() + "_TabPlacement", tabPlacement);
       }
       createView.getMainTabbedPane().setTabPlacement(Integer.parseInt(tabPlacement));
       view.setLocationRelativeTo(null);
     }
     return view;
   } catch (Exception e) {
     log.error("ChatController static", e);
     JOptionPane.showMessageDialog(
         null, "init msg frame error", "error", JOptionPane.ERROR_MESSAGE);
   }
   return null;
 }
Beispiel #2
0
 public void broadcastMyIpAddress(String user, int status) throws Exception {
   if (status == Constants.STATUS_ONLINE
       || status == Constants.STATUS_AWAY
       || status == Constants.STATUS_BUSY) {
     LoginInfo info = context.getDataManager().getValue(Constants.DataKey.LOGGININFO.toString());
     MemberBean bean = new MemberBean();
     bean.setLccAccount(info.getUsername());
     String[] allLocalHostIP = NetworkUtil.getAllLocalHostIP();
     for (int i = 0; i < allLocalHostIP.length; i++) {
       log.info(i + " : " + allLocalHostIP[i]);
     }
     int networkinterfaceIndex =
         Vovo.getConfigManager().getIntProperty("networkinterfaceIndex", 0);
     bean.setIp(allLocalHostIP[networkinterfaceIndex]);
     Vovo.getLcmUtil().broadcastMyIpAddress(bean, info.getUsername(), user);
     log.info("vovo broadcastMyIpAddress " + bean + "," + info.getUsername() + "," + user);
   }
 }