📄 vijxtadialogpanel.java
字号:
}else{ // we are only transmitting } }else if(protocolState == ViJxtaCallControl.SESSION_VIJXTA_INCALL) { updateProtocolStateLabel("IN_CALL");; EventQueue.invokeLater(new Runnable() { public void run() { messageLabel.setText( STRINGS.getString("label.vojxta.connectedto") + " " + getCallControl().getRemoteMonitorControl().getOriginator()); placeAcceptCallButton.setEnabled(false); holdResumeCallButton.setEnabled(true); endCallButton.setEnabled(true); if(getCallControl().getLocalVideoSourceType() != ViJxtaCallControl.NO_DEVICE && getCallControl().getLocalMonitorControl().isTransmit()) { getCallControl().getLocalMonitorControl().startMonitor(); getCallControl().getLocalMonitorControl().startMonitorCapture(); getCallControl().getLocalMonitorControl().startTransmit(); if(getCallControl().getLocalMonitorControl().getMonitorComponent() == null) { EventQueue.invokeLater(new Runnable() { public void run() { errorMessageLabel.setText("LocalMonitorControl not available: No Video Device Chosen"); showPanel(ERROR_PANEL); } }); if (LOG.isEnabledFor(Level.INFO)) { LOG.info("LocalMonitorControlComponent is NULL, Ending Call"); } getCallControl().viewActionEndCall(); }else{ localMonitorPanel.add(getCallControl().getLocalMonitorControl().getMonitorComponent()); } String refreshRateLabel = getCallControl().getLocalMonitorControl().getRefreshRateUnitLabel(); refreshRateLabel = refreshRateLabel != null ? "Refresh Rate (" + refreshRateLabel + ")" : "Refresh Rate"; refreshRateSlider.setBorder(new TitledBorder(refreshRateLabel)); refreshRateSlider.setEnabled(true); } if(getCallControl().remotePeerTransmit && getCallControl().getRemoteMonitorControl().isReceive() ) { getCallControl().getRemoteMonitorControl().startMonitor(); getCallControl().getRemoteMonitorControl().startReceive(); if(getCallControl().getRemoteMonitorControl().getMonitorComponent() == null) { EventQueue.invokeLater(new Runnable() { public void run() { errorMessageLabel.setText("RemoteMonitorControl not available"); // showPanel (ERROR_PANEL); } }); if (LOG.isEnabledFor(Level.INFO)) { LOG.info("RemoteMonitorControlComponent is Null, Ending Call"); } //xxx: do we really need to termintate this call just // bc we can't get a remote monitor component? getCallControl().viewActionEndCall(); }else{ remoteMonitorPanel.add(getCallControl().getRemoteMonitorControl().getMonitorComponent()); } } } }); updateThread.start(); }else if(protocolState == ViJxtaCallControl.SESSION_VIJXTA_HOLD_REQUEST_RECEIVED) { updateProtocolStateLabel(ViJxtaCallControl.COMMAND_VIJXTA_HOLD_REQUEST + " Received"); EventQueue.invokeLater(new Runnable() { public void run() { holdResumeCallButton.setEnabled(false); } }); }else if(protocolState == ViJxtaCallControl.SESSION_VIJXTA_HOLD_ACCEPT_RECEIVED) { updateProtocolStateLabel(ViJxtaCallControl.COMMAND_VIJXTA_HOLD_ACCEPT + " Received"); EventQueue.invokeLater(new Runnable() { public void run() { holdResumeCallButton.setText(STRINGS.getString("label.vijxta.resumecall")); holdResumeCallButton.setEnabled(true); } }); }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 (LOG.isEnabledFor(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); }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -