📄 vijxtadialogview.java
字号:
transmitCheckBox.setSelected(false); transmitCheckBox.setEnabled(false); } }); } else { EventQueue.invokeLater(new Runnable() { public void run() { transmitCheckBox.setSelected(true); if (getCallControl().getLocalVideoSourceType() == ViJxtaCallControl.NO_DEVICE) { imageQualitySlider.setEnabled(false); } else { imageQualitySlider.setEnabled(true); } } }); } EventQueue.invokeLater(new Runnable() { public void run() { receiveCheckBox.setSelected(true); receiveCheckBox.setEnabled(true); } }); } private void localActionFormatChosen() { if (formatsList.getSelectedIndex() == -1) { return; } String selectedFormat = (String) formatsList.getSelectedValue(); ((LocalDeviceMonitorControl) this.getCallControl().getLocalMonitorControl()).setFormat(selectedFormat); this.setupMonitorTestPanel(); this.showConfigPanel(this.CONFIG_TEST_PANEL); } private void setupMonitorTestPanel() { this.getCallControl().getLocalMonitorControl().obtainHardware(); this.getCallControl().getLocalMonitorControl().startMonitor(); for (int i = 0; i < 5; i++) { if (getCallControl().getLocalMonitorControl().getFormatSize().width != 0) { break; } try { Thread.sleep(1000); } catch (InterruptedException ix) { ix.printStackTrace(); } } Dimension size = getCallControl().getLocalMonitorControl().getFormatSize(); LOG.info("testMonitorPanel Size " + size); monitorTestPanel.setSize(new Dimension(size.width + 40, size.height + 40)); monitorTestPanel.add(this.getCallControl().getLocalMonitorControl().getMonitorComponent()); this.updateMessageLabel("Click Next if you see live video."); } protected void localActionMonitorTestUnSuccessful() { this.getCallControl().getLocalMonitorControl().resetMonitor(); if (getCallControl().getLocalVideoSourceType() == ViJxtaCallControl.NETWORKED_DEVICE) { this.showConfigPanel(this.CONFIG_NETWORKED_DEVICES_PANEL); } else if (getCallControl().getLocalVideoSourceType() == ViJxtaCallControl.LOCAL_DEVICE) { this.showConfigPanel(this.CONFIG_LOCAL_DEVICES_PANEL); } } protected void localActionMonitorTestSuccessful() { //this.monitorTestPanel.remove (this.getCallControl ().getLocalMonitorControl ().getMonitorComponent ()); this.monitorTestComponent = null; this.setupOptionsPanel(); this.showConfigPanel(this.CONFIG_LOCAL_OPTIONS_PANEL); } protected void localActionApplyConfigSettings() { getCallControl().getLocalMonitorControl().setTransmit(this.transmitCheckBox.isSelected()); this.getCallControl().getRemoteMonitorControl().setReceive(this.receiveCheckBox.isSelected()); if (Logging.SHOW_INFO && LOG.isLoggable(Level.INFO)) { LOG.info("Apply Config Settings"); LOG.info("LocalMonitor Control Transmit = " + getCallControl().getLocalMonitorControl().isTransmit()); LOG.info("RemoteMonitor Control Receive = " + getCallControl().getRemoteMonitorControl().isReceive()); } this.getCallControl().viewActionConfigured(); this.updateMessageLabel("Ready."); this.showPanel(this.CALL_CONTROL_PANEL); } protected void localActionPlaceAcceptCall() { EventQueue.invokeLater(new Runnable() { public void run() { placeAcceptCallButton.setEnabled(false); } }); if (placeAcceptCallButton.getText().equals(STRINGS.getString("action.vijxta.placecall"))) { this.getCallControl().viewActionPlaceCall(); } else if (placeAcceptCallButton.getText().equals(STRINGS.getString("action.vijxta.acceptcall"))) { this.getCallControl().viewActionAcceptCall(); } } private void localActionDownloadJmf() { try { ExecFactory.getExec().execDocument(new URL(URL_JMF_DOWNLOAD)); } catch (MalformedURLException mux) { mux.printStackTrace(); } } private void localActionImageQualityChanged(int value) { getCallControl().getLocalMonitorControl().setImageCompression(value); } protected void localActionHoldResumeCall() { String buttonText = null; if (this.getCallControl().getProtocolState() == this.getCallControl().SESSION_VIJXTA_INCALL) { this.getCallControl().viewActionHoldCall(); buttonText = STRINGS.getString("action.vijxta.holdcall"); } else if (this.getCallControl().getProtocolState() == this.getCallControl().SESSION_VIJXTA_HOLDING) { this.getCallControl().viewActionResumeCall(); buttonText = STRINGS.getString("action.vijxta.resumecall"); } final String finalButtonText = buttonText; EventQueue.invokeLater(new Runnable() { public void run() { holdResumeCallButton.setText(finalButtonText); } }); } protected void localActionEndCall() { EventQueue.invokeLater(new Runnable() { public void run() { placeAcceptCallButton.setEnabled(false); holdResumeCallButton.setEnabled(false); endCallButton.setEnabled(false); } }); this.getCallControl().viewActionEndCall(); } private void UI() { this.setPreferredSize(new Dimension(440, 300)); double sizes[][] = {{TableLayout.FILL}, {TableLayout.PREFERRED, TableLayout.FILL}}; TableLayout tbl = new TableLayout(sizes); JPanel uiPanel = new JPanel(tbl); uiPanel.add(buildMessagePanel(), "0,0,l,c"); cardLayout = new CardLayout(); deckPanel = new JPanel(cardLayout); deckPanel.add(buildNoResponsePanel(), NO_RESPONSE_PANEL); deckPanel.add(buildConfigPanel(), CONFIG_PANEL); deckPanel.add(this.buildCallControlPanel(), this.CALL_CONTROL_PANEL); deckPanel.add(this.buildStatsPanel(), this.STATS_PANEL); deckPanel.add(this.buildErrorPanel(), this.ERROR_PANEL); deckPanel.add(this.buildIdlePanel(), this.IDLE_PANEL); uiPanel.add(deckPanel, "0,1,c,c"); showPanel(this.NO_RESPONSE_PANEL); this.add(uiPanel); } private JPanel buildErrorPanel() { double sizes[][] = {{TableLayout.PREFERRED}, {TableLayout.PREFERRED, TableLayout.PREFERRED}}; TableLayout tbl = new TableLayout(sizes); JPanel panel = new JPanel(tbl); errorMessageLabel = new JLabel("ERROR"); panel.add(errorMessageLabel, "0,0"); return panel; } private JPanel buildMessagePanel() { double b = 5; double sizes[][] = {{b, TableLayout.FILL, b}, {b, TableLayout.PREFERRED, b, TableLayout.PREFERRED, b, TableLayout.PREFERRED, b}}; TableLayout tbl = new TableLayout(sizes); JPanel panel = new JPanel(tbl); productLabel = new JLabel("viJXTA .01"); //productLabel.setFont (new Font ("Arial", Font.BOLD, 14)); productLabel.setForeground(new Color(0.0f, 0.0f, 0.0f, 0.5f)); panel.add(productLabel, "1,1,l,c"); protocolStateLabel = new JLabel("protocolState"); panel.add(protocolStateLabel, "1,3,l,c"); messageLabel = new JLabel("Message"); messageLabel.setFont(new Font("Arial", Font.BOLD, 14)); messageLabel.setForeground(new Color(0.0f, 0.0f, 0.0f)); panel.add(messageLabel, "1,5,c,c"); return panel; } private JPanel buildConfigPanel() { configCardLayout = new CardLayout(); configDeckPanel = new JPanel(configCardLayout); configDeckPanel.add(buildConfigChooseVideoSourcePanel(), this.CONFIG_VIDEO_SOURCE_PANEL); configDeckPanel.add(buildConfigLocalDevicesPanel(), this.CONFIG_LOCAL_DEVICES_PANEL); configDeckPanel.add(buildConfigNetworkedDevicesPanel(), this.CONFIG_NETWORKED_DEVICES_PANEL); configDeckPanel.add(buildConfigFormatsPanel(), this.CONFIG_FORMATS_PANEL); configDeckPanel.add(this.buildConfigLocalOptionsPanel(), this.CONFIG_LOCAL_OPTIONS_PANEL); configDeckPanel.add(buildConfigTestPanel(), this.CONFIG_TEST_PANEL); this.showConfigPanel(this.CONFIG_VIDEO_SOURCE_PANEL); return configDeckPanel; } private JPanel buildConfigChooseVideoSourcePanel() { double b = 5; double sizes[][] = {{TableLayout.PREFERRED}, {TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED}}; TableLayout tbl = new TableLayout(sizes); JPanel panel = new JPanel(tbl); panel.setBorder(new TitledBorder("VideoSource")); JRadioButton localDeviceRadioButton = new JRadioButton("Local Webcam (FireWire 1394 or USB)"); panel.add(localDeviceRadioButton, "0,0"); localDeviceRadioButton.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { localDevice = e.getStateChange() == e.SELECTED ? true : false; } }); JRadioButton networkedDeviceRadioButton = new JRadioButton("Networked Webcam (URL)"); panel.add(networkedDeviceRadioButton, "0,1"); networkedDeviceRadioButton.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { networkedDevice = e.getStateChange() == e.SELECTED ? true : false; } }); JRadioButton noDeviceRadioButton = new JRadioButton("No Webcam (Receive Only)"); panel.add(noDeviceRadioButton, "0,2"); noDeviceRadioButton.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { noDevice = e.getStateChange() == e.SELECTED ? true : false; } }); ButtonGroup bGroup = new ButtonGroup(); bGroup.add(localDeviceRadioButton); bGroup.add(networkedDeviceRadioButton); bGroup.add(noDeviceRadioButton); JButton nextButton = new JButton("Next >"); panel.add(nextButton, "0,3,c,c"); nextButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { localActionVideoSourceChosen(); } }); return panel; } private JPanel buildIdlePanel() { double b = 20; double sizes[][] = {{b, TableLayout.FILL, b}, {b, TableLayout.FILL, b}}; TableLayout tbl = new TableLayout(sizes); JPanel panel = new JPanel(tbl); JLabel tempLabel = new JLabel("LOGO Goes Here."); panel.add(tempLabel, "1,1,c,c"); return panel; } private JPanel buildNoResponsePanel() { double sizes[][] = {{TableLayout.FILL}, {TableLayout.FILL}}; TableLayout tbl = new TableLayout(sizes); JPanel panel = new JPanel(tbl); return panel;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -