public void stopControlRemoteDesktop(String remoteUserName) throws Exception { log.info("stopControlRemoteDesktop " + remoteUserName); VncViewer viewer = viewerMap.get("vncview_" + remoteUserName); if (viewer != null) { viewer.setViewOnly(true); MaxVncPanelWindow component = ViewManager.getComponent(MaxVncPanelWindow.class); if (component.isVisible()) { VncViewPanel viewPanel = component.getVncViewPanel(); viewPanel.getAskforControlButton().setEnabled(true); viewPanel.getStopControlButton().setEnabled(false); } else { DockingLayoutMeetingPanel dockingLayoutMeetingPanel = ViewManager.getComponent(DockingLayoutMeetingPanel.class); View findInViewMap = dockingLayoutMeetingPanel.findInViewMap("vncview_" + remoteUserName); if (findInViewMap != null) { VncViewPanel viewPanel = (VncViewPanel) findInViewMap.getComponent(); viewPanel.getAskforControlButton().setEnabled(true); viewPanel.getStopControlButton().setEnabled(false); } } ShareFileServerUtil.getInstance() .startScreenShareToOneClientCallBack( DataUtil.getLoginInfo().getConfno(), remoteUserName, DataUtil.getLoginInfo().getUsername(), "DESKTOP_NOTCONTROL", "-1"); } }
@Override public void modelPropertyChange(PropertyChangeEvent evt) { String propName = evt.getPropertyName(); Object newValue = evt.getNewValue(); if (BookController.CommonProps.REFRESH.check(propName)) { View newView = (View) evt.getNewValue(); View view = (View) getParent().getParent(); if (view == newView) { init(); refresh(); } return; } if (BookController.CommonProps.SHOW_OPTIONS.check(propName)) { View view = (View) evt.getNewValue(); if (!view.getName().equals(ViewName.MANAGE.toString())) { return; } ManageOptionsDialog dlg = new ManageOptionsDialog(mainFrame); SwingUtil.showModalDialog(dlg, this); return; } if (BookController.ManageViewProps.SHOW_ENTITY.check(propName)) { if (newValue instanceof Scene) { Scene scene = (Scene) newValue; ViewUtil.scrollToScene(this, panel, scene); return; } if (newValue instanceof Chapter) { Chapter chapter = (Chapter) newValue; ViewUtil.scrollToChapter(this, panel, chapter); return; } } if (BookController.ManageViewProps.COLUMNS.check(propName)) { init(); refresh(); return; } if (BookController.PartProps.CHANGE.check(propName)) { refresh(); ViewUtil.scrollToTop(scroller); return; } if (BookController.ChapterProps.DELETE.check(propName) || BookController.ChapterProps.DELETE_MULTI.check(propName) || BookController.ChapterProps.NEW.check(propName)) { refresh(); return; } if (BookController.StrandProps.DELETE.check(propName)) { refresh(); return; } dispatchToChapterPanels(this, evt); }
// 被动关闭 public void stopDesktopView(String remoteUserName) throws Exception { log.info("stopDesktopView"); VncViewer viewer = viewerMap.get("vncview_" + remoteUserName); if (viewer == null) { return; } viewer.setCustomProperty("IsDestroy", "true"); viewer.setEnabled(false); viewer.disconnect(); viewer.destroy(); // dispose! VncViewPanel viewPanel = null; MaxVncPanelWindow maxVncPanelWindow = ViewManager.getComponent(MaxVncPanelWindow.class); DockingLayoutMeetingPanel dockingLayoutMeetingPanel = ViewManager.getComponent(DockingLayoutMeetingPanel.class); View findInViewMap = dockingLayoutMeetingPanel.findInViewMap("vncview_" + remoteUserName); if (maxVncPanelWindow.isVisible()) { viewPanel = maxVncPanelWindow.getVncViewPanel(); } else { if (findInViewMap != null) { viewPanel = (VncViewPanel) findInViewMap.getComponent(); } } if (viewPanel != null && viewPanel.isConnected()) { final JDialog jDialog = new JDialog(ViewManager.getComponent(MainFrame.class), false); jDialog.addWindowListener( new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent e) { jDialog.dispose(); } }); final JOptionPane jOptionPane = new JOptionPane("远程桌面 " + remoteUserName + " 的连接已经断开", JOptionPane.INFORMATION_MESSAGE); jDialog.setContentPane(jOptionPane); jDialog.setTitle("信息提示"); jOptionPane.addPropertyChangeListener( new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { String propertyName = evt.getPropertyName(); // System.out.println(propertyName+" , "+evt.getSource()); if (jDialog.isVisible() && evt.getSource() == jOptionPane && propertyName.equals(JOptionPane.VALUE_PROPERTY)) { // jDialog.setVisible(false); jDialog.dispose(); } } }); jDialog.pack(); FadeWindow fadeWindow = new FadeWindow(jDialog); fadeWindow.setVisible(true); fadeWindow.setPosistionInRightBottom(); fadeWindow.startFadeIn(); } maxVncPanelWindow.setVncViewPanel(null); maxVncPanelWindow.dispose(); dockingLayoutMeetingPanel.removePanel("vncview_" + remoteUserName); viewerMap.put("vncview_" + remoteUserName, null); ShareFileServerUtil.getInstance() .startScreenShareToOneClientCallBack( DataUtil.getLoginInfo().getConfno(), remoteUserName, DataUtil.getLoginInfo().getUsername(), "DESKTOP_STOPVIWE", "-1"); log.debug("stopDesktopView End"); }