public void getRepeaterIDCallBack(Map<String, Integer> repeaterids) throws Exception { log.info("getRepeaterIDCallBack"); if (screenshareflag) { if (!looThread.isAlive()) { looThread.start(); } Iterator<Entry<String, Integer>> iterator = repeaterids.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry<java.lang.String, java.lang.Integer> entry = (Map.Entry<java.lang.String, java.lang.Integer>) iterator.next(); String remoteUserName = entry.getKey().substring(entry.getKey().indexOf("-") + 1); if (!remoteUserName.equals(DataUtil.getLoginInfo().getUsername())) { addToWaitList(remoteUserName, entry.getValue() + "", true); } } // DockingLayoutMeetingPanel panel = // DataUtil.getValue(DataUtil.Key.DockingLayoutMeetingPanel); // panel.getStartScreenShareMI().setEnabled(false); // panel.getStopScreenShareMI().setEnabled(true); MainFrame mainFrame = ViewManager.getComponent(MainFrame.class); mainFrame .getShareDesktopButton() .setText(StringUtil.getUIString("DockingLayoutMeetingPanel.stopScreenShareMI.text")); mainFrame.getShareDesktopButton().setEnabled(true); // screenshareflag = false; } }
public void stopScreenShare() throws Exception { log.info("取消共享桌面"); try { waitlist.clear(); services.getScreenShareService().stopScreenShare(); // 同一时间只有一个被共享者,可以kill services.getScreenShareService().stopScreenShareProcess(); MainFrame mainFrame = ViewManager.getComponent(MainFrame.class); mainFrame .getShareDesktopButton() .setText(StringUtil.getUIString("DockingLayoutMeetingPanel.screenShareMenu.text")); // mainFrame.getShareDesktopButton().setEnabled(false); screenshareflag = false; } catch (Exception ex) { log.error("stopScreenShare", ex); } }
public void startScreenShare() throws Exception { log.info("启动共享桌面"); try { List<MemberDto> members = (List<MemberDto>) ControllerFacade.execute("mainController", "getOpenfireMemberList"); String[] targetusers = new String[members.size()]; for (int i = 0; i < members.size(); i++) { MemberDto memberDto = members.get(i); targetusers[i] = memberDto.getName(); } MainFrame mainFrame = ViewManager.getComponent(MainFrame.class); mainFrame .getShareDesktopButton() .setText(StringUtil.getUIString("DockingLayoutMeetingPanel.stopScreenShareMI.text")); mainFrame.getShareDesktopButton().setEnabled(false); boolean processExists = com.lorent.common.util.ProcessUtil.getInstance().processExists("winvnc.exe"); if (!processExists) { /* Double osVersion = PlatformUtil.getOSVersion(); if ( osVersion >= 6.0f) { Process startScreenShareProcess = services.getScreenShareService().startScreenShareProcess(); DataUtil.setValue(DataUtil.Key.ScreenShareProcess, startScreenShareProcess); } else{ services.getScreenShareService().installScreenShareService(); } */ Process startScreenShareProcess = services.getScreenShareService().startScreenShareProcess(); DataUtil.setValue(DataUtil.Key.ScreenShareProcess, startScreenShareProcess); } screenshareflag = true; services.getScreenShareService().getRepeaterIDsFromServer(targetusers); new Thread() { @Override public void run() { try { Thread.sleep(10000); MainFrame mainFrame = ViewManager.getComponent(MainFrame.class); if (screenshareflag && !mainFrame.getShareDesktopButton().isEnabled()) { log.info("启动共享桌面超时"); mainFrame .getShareDesktopButton() .setText( StringUtil.getUIString("DockingLayoutMeetingPanel.screenShareMenu.text")); mainFrame.getShareDesktopButton().setEnabled(true); screenshareflag = false; } } catch (Exception e) { e.printStackTrace(); log.error("startScreenShare", e); } } }.start(); } catch (Exception ex) { log.error("startScreenShare", ex); } }