📄 vijxtadialogview.java
字号:
} else if (protocolState == ViJxtaCallControl.SESSION_VIJXTA_RESUME_REQUEST_RECEIVED) { updateProtocolStateLabel(ViJxtaCallControl.COMMAND_VIJXTA_RESUME_REQUEST + " Received"); EventQueue.invokeLater(new Runnable() { public void run() { holdResumeCallButton.setEnabled(true); } }); } else if (protocolState == ViJxtaCallControl.SESSION_VIJXTA_RESUME_ACCEPT_RECEIVED) { updateProtocolStateLabel(ViJxtaCallControl.COMMAND_VIJXTA_RESUME_ACCEPT + " Received"); EventQueue.invokeLater(new Runnable() { public void run() { holdResumeCallButton.setText(STRINGS.getString("label.vijxta.holdcall")); holdResumeCallButton.setEnabled(true); } }); } else if (protocolState == ViJxtaCallControl.SESSION_VIJXTA_HANGUP_REQUEST_SENT) { updateProtocolStateLabel(ViJxtaCallControl.COMMAND_VIJXTA_HANGUP_REQUEST + " Sent"); this.updateThreadRun = false; } else if (protocolState == ViJxtaCallControl.SESSION_VIJXTA_HANGUP_REQUEST_RECEIVED) { updateProtocolStateLabel(ViJxtaCallControl.COMMAND_VIJXTA_HANGUP_REQUEST + " Received"); EventQueue.invokeLater(new Runnable() { public void run() { holdResumeCallButton.setEnabled(false); endCallButton.setEnabled(false); } }); this.updateThreadRun = false; } else if (protocolState == ViJxtaCallControl.SESSION_VIJXTA_DISCONNECT_REQUEST_RECEIVED) { EventQueue.invokeLater(new Runnable() { public void run() { holdResumeCallButton.setEnabled(false); endCallButton.setEnabled(false); } }); updateProtocolStateLabel(ViJxtaCallControl.COMMAND_VIJXTA_DISCONNECT_REQUEST + " Received"); } else if (protocolState == ViJxtaCallControl.SESSION_VIJXTA_DISCONNECTED) { setInSession(false); setInitiatedLocally(false); EventQueue.invokeLater(new Runnable() { public void run() { holdResumeCallButton.setEnabled(false); endCallButton.setEnabled(false); } }); this.getCallControl().destroy(); if (getCallControl().getErrorMessage() != null) { this.updateMessageLabel("ERROR! " + getCallControl().getErrorMessage()); } else { this.updateMessageLabel("Idle. Ready to close."); } updateProtocolStateLabel("DISCONNECTED"); } } private void updateProtocolStateLabel(final String protocolState) { if (protocolStateLabel != null) { EventQueue.invokeLater(new Runnable() { public void run() { protocolStateLabel.setText(protocolState); } }); } } private void updateJmfErrorLabel(final String message) { if (messageLabel != null) { EventQueue.invokeLater(new Runnable() { public void run() { jmfErrorLabel.setText(message); jmfErrorLabel.setVisible(true); } }); } } private void updateMessageLabel(final String message) { if (messageLabel != null) { EventQueue.invokeLater(new Runnable() { public void run() { messageLabel.setText(message); } }); } } private void updateErrorMessageLabel(final String message) { if (messageLabel != null) { EventQueue.invokeLater(new Runnable() { public void run() { errorMessageLabel.setText(message); } }); } } private ViJxtaCallControl getCallControl() { return this.viJxtaCallControl; } public Dialog getDialog() { return this.viJxtaDialog; } public void dismiss() { if (Logging.SHOW_INFO && LOG.isLoggable(Level.INFO)) { LOG.info("Dismiss"); } if (this.getCallControl() != null) { if (this.getCallControl().getLocalMonitorControl() != null) { this.getCallControl().getLocalMonitorControl().stopTransmit(); this.getCallControl().getLocalMonitorControl().stopMonitorCapture(); this.getCallControl().getLocalMonitorControl().stopMonitor(); this.getCallControl().destroy(); } if (this.getCallControl().getRemoteMonitorControl() != null) { this.getCallControl().getRemoteMonitorControl().stopReceive(); this.getCallControl().getRemoteMonitorControl().stopMonitor(); } this.getCallControl().destroy(); } } private void setupLocalDevicesPanel() { DefaultListModel captureDevicesModel = new DefaultListModel(); Iterator devices = null; if (getCallControl().getLocalVideoSourceType() == ViJxtaCallControl.LOCAL_DEVICE) { devices = ((LocalDeviceMonitorControl) getCallControl().getLocalMonitorControl()).getCaptureDeviceNames(); } else { devices = Collections.EMPTY_LIST.iterator(); } if (devices.hasNext()) { while (devices.hasNext()) { String deviceName = (String) devices.next(); captureDevicesModel.addElement(deviceName); } this.updateMessageLabel("Please choose capture device."); } else { noLocalCaptureDevicesFound = true; captureDevicesModel.addElement("No Capture Devices Found"); if (getCallControl().getLocalVideoSourceType() == ViJxtaCallControl.LOCAL_DEVICE) { // jmf installed but no cap devices found this.updateMessageLabel("No known capture devices available. Receving only."); } else { this.updateMessageLabel("Java Media Framework Not Present. Receving only."); this.updateJmfErrorLabel(this.JMF_ERROR_MESSAGE); } } captureDevicesList.setModel(captureDevicesModel); } public void setInitiatedLocally(boolean p_initiatedLocally) { initiatedLocally = p_initiatedLocally; setInSession(p_initiatedLocally); } protected boolean isInitiatedLocally() { return initiatedLocally; } public boolean isInSession() { return inSession; } protected void setInSession(boolean p_inSession) { inSession = p_inSession; } protected void showPanel(final String panelName) { EventQueue.invokeLater(new Runnable() { public void run() { cardLayout.show(deckPanel, panelName); } }); } protected void showConfigPanel(final String panelName) { EventQueue.invokeLater(new Runnable() { public void run() { configCardLayout.show(configDeckPanel, panelName); } }); } protected void setupNetworkedDevicesPanel() { } protected void localActionVideoSourceChosen() { if (localDevice) { getCallControl().setLocalVideoSourceType(ViJxtaCallControl.LOCAL_DEVICE); this.setupLocalDevicesPanel(); this.showConfigPanel(this.CONFIG_LOCAL_DEVICES_PANEL); } else if (networkedDevice) { getCallControl().setLocalVideoSourceType(ViJxtaCallControl.NETWORKED_DEVICE); this.setupNetworkedDevicesPanel(); this.showConfigPanel(this.CONFIG_NETWORKED_DEVICES_PANEL); } else if (noDevice) { getCallControl().setLocalVideoSourceType(ViJxtaCallControl.NO_DEVICE); this.setupOptionsPanel(); this.showConfigPanel(this.CONFIG_LOCAL_OPTIONS_PANEL); } } public void localActionNetworkedCaptureDeviceChosen() { ((NetworkedDeviceMonitorControl) getCallControl(). getLocalMonitorControl()).setAuthenticated(this.authenticationCheckBox.isSelected()); ((NetworkedDeviceMonitorControl) getCallControl(). getLocalMonitorControl()).setURL(this.networkedSourceURLTextField.getText()); if (authenticationCheckBox.isSelected()) { ((NetworkedDeviceMonitorControl) getCallControl(). getLocalMonitorControl()).setUserName(this.authenticationUserNameTextField.getText()); ((NetworkedDeviceMonitorControl) getCallControl(). getLocalMonitorControl()).setPassword(this.authenticationPasswordTextField.getText()); } this.setupMonitorTestPanel(); this.showConfigPanel(this.CONFIG_TEST_PANEL); } protected void localActionCaptureDeviceChosen() { if (noLocalCaptureDevicesFound) { this.setupOptionsPanel(); this.showConfigPanel(this.CONFIG_LOCAL_OPTIONS_PANEL); } else { if (captureDevicesList.getSelectedIndex() == -1) { return; } String deviceName = (String) captureDevicesList.getSelectedValue(); ((LocalDeviceMonitorControl) this.getCallControl().getLocalMonitorControl()).setCaptureDevice(deviceName); this.setupFormatsPanel(); this.showConfigPanel(this.CONFIG_FORMATS_PANEL); } } private void setupFormatsPanel() { DefaultListModel formatsModel = new DefaultListModel(); Iterator itr = ((LocalDeviceMonitorControl) this.getCallControl().getLocalMonitorControl()).getCaptureDeviceFormats(); while (itr.hasNext()) { String formatSize = (String) itr.next(); formatsModel.addElement(formatSize); } this.updateMessageLabel("Please choose video capture size."); formatsList.setModel(formatsModel); } private void setupOptionsPanel() { this.updateMessageLabel("Please choose desired options for this session."); if (this.noLocalCaptureDevicesFound || getCallControl().getLocalVideoSourceType() == ViJxtaCallControl.NO_DEVICE) { EventQueue.invokeLater(new Runnable() { public void run() {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -