📄 vojxtadialogpanel.java
字号:
gbc.weighty = 1; gbc.gridheight = 1; gbc.gridwidth = 3; messagePanel.setBorder (null); gbl.setConstraints (messagePanel, gbc); callPanel.add (messagePanel); JPanel statusPanel = new JPanel (); gbc.fill = gbc.NONE; gbc.anchor = gbc.CENTER; gbc.gridx = 1; gbc.gridy = 2; gbc.insets = panelInsets; gbc.weightx = 1; gbc.weighty = 1; gbc.gridheight = 1; gbc.gridwidth = 1; statusPanel.setBorder (null); gbl.setConstraints (statusPanel, gbc); callPanel.add (statusPanel); JPanel micPanel = new JPanel (); gbc.fill = gbc.NONE; gbc.anchor = gbc.CENTER; gbc.gridx = 0; gbc.gridy = 1; gbc.insets = panelInsets; gbc.weightx = 1; gbc.weighty = 1; gbc.gridheight = 2; gbc.gridwidth = 1; micPanel.setBorder (null); gbl.setConstraints (micPanel, gbc); callPanel.add (micPanel); JPanel speakerPanel = new JPanel (); gbc.fill = gbc.NONE; gbc.anchor = gbc.CENTER; gbc.gridx = 2; gbc.gridy = 1; gbc.insets = panelInsets; gbc.weightx = 1; gbc.weighty = 1; gbc.gridheight = 2; gbc.gridwidth = 1; speakerPanel.setBorder (null); gbl.setConstraints (speakerPanel, gbc); callPanel.add (speakerPanel); JPanel callControlPanel = new JPanel (); gbc.fill = gbc.NONE; gbc.anchor = gbc.CENTER; gbc.gridx = 1; gbc.gridy = 1; gbc.insets = panelInsets; gbc.weightx = 1; gbc.weighty = 1; gbc.gridheight = 1; gbc.gridwidth = 1; callControlPanel.setBorder (null); gbl.setConstraints (callControlPanel, gbc); callPanel.add (callControlPanel); //add sub components to message panel messageLabel = new JLabel (STRINGS.getString ("label.vojxta.welcome")); messageLabel.setFont (new Font ("Arial", Font.BOLD, 18)); messagePanel.add (messageLabel); // add sub components to status Panel statusLabel = new JLabel (STRINGS.getString ("label.vojxta.disconnected")); statusLabel.setFont (new Font ("Arial", Font.BOLD, 16)); statusPanel.add (statusLabel); // add subcomponents to mic Panel GridBagLayout micPanelLayout = new GridBagLayout (); micPanel.setLayout (micPanelLayout); micPanel.setVisible (true); micVolumeSlider = new JSlider (SwingConstants.VERTICAL,0,100, 20); gbc.fill = gbc.VERTICAL; gbc.anchor = gbc.CENTER; gbc.gridx = 0; gbc.gridy = 1; gbc.insets = subComponentInsets; gbc.weightx = 1; gbc.weighty = 1; gbc.gridheight = 1; gbc.gridwidth = 1; micPanelLayout.setConstraints (micVolumeSlider, gbc); micVolumeSlider.setSnapToTicks (false); micVolumeSlider.addChangeListener (new ChangeListener () { public void stateChanged (ChangeEvent e) { // TODO : } }); micVolumeSlider.setEnabled (false); micPanel.add (micVolumeSlider); micMuteCheckBox = new JCheckBox (); gbc.fill = gbc.NONE; gbc.anchor = gbc.CENTER; gbc.gridx = 0; gbc.gridy = 2; gbc.insets = subComponentInsets; gbc.weightx = 1; gbc.weighty = .1; gbc.gridheight = 1; gbc.gridwidth = 1; micPanelLayout.setConstraints (micMuteCheckBox, gbc); micMuteCheckBox.setSelected (false); micMuteCheckBox.addItemListener (new ItemListener () { public void itemStateChanged (ItemEvent e) { if (e.getStateChange () == ItemEvent.SELECTED) { // TODO : }else if (e.getStateChange () == ItemEvent.DESELECTED) { // TODO : } } }); micPanel.add (micMuteCheckBox); JLabel micMuteLabel = new JLabel (STRINGS.getString ("label.vojxta.mute")); gbc.fill = gbc.NONE; gbc.anchor = gbc.CENTER; gbc.gridx = 0; gbc.gridy = 3; gbc.insets = subComponentInsets; gbc.weightx = 1; gbc.weighty = .1; gbc.gridheight = 1; gbc.gridwidth = 1; micPanelLayout.setConstraints (micMuteLabel, gbc); micPanel.add (micMuteLabel); micLabel = new JLabel (STRINGS.getString ("label.vojxta.mic")); gbc.fill = gbc.VERTICAL; gbc.anchor = gbc.CENTER; gbc.gridx = 0; gbc.gridy = 0; gbc.insets = subComponentInsets; gbc.weightx = 1; gbc.weighty = .1; gbc.gridheight = 1; gbc.gridwidth = 1; micPanelLayout.setConstraints (micLabel, gbc); micPanel.add (micLabel); // add subcomponents to speaker Panel GridBagLayout speakerPanelLayout = new GridBagLayout (); speakerPanel.setLayout (speakerPanelLayout); speakerVolumeSlider = new JSlider (SwingConstants.VERTICAL,0,0,0); gbc.fill = gbc.VERTICAL; gbc.anchor = gbc.CENTER; gbc.gridx = 0; gbc.gridy = 1; gbc.insets = subComponentInsets; gbc.weightx = 1; gbc.weighty = 1; gbc.gridheight = 1; gbc.gridwidth = 1; speakerPanelLayout.setConstraints (speakerVolumeSlider, gbc); speakerVolumeSlider.setSnapToTicks (false); speakerVolumeSlider.addChangeListener (new ChangeListener () { public void stateChanged (ChangeEvent e) { // TODO : localActionSpeakerGainChanged (speakerVolumeSlider.getValue ()); } }); speakerVolumeSlider.setEnabled (false); speakerPanel.add (speakerVolumeSlider); speakerMuteCheckBox = new JCheckBox (); gbc.fill = gbc.NONE; gbc.anchor = gbc.CENTER; gbc.gridx = 0; gbc.gridy = 2; gbc.insets = subComponentInsets; gbc.weightx = 1; gbc.weighty = .1; gbc.gridheight = 1; gbc.gridwidth = 1; speakerPanelLayout.setConstraints (speakerMuteCheckBox, gbc); speakerMuteCheckBox.setSelected (false); speakerMuteCheckBox.addItemListener (new ItemListener () { public void itemStateChanged (ItemEvent e) { if (e.getStateChange () == ItemEvent.SELECTED) { // TODO : }else if (e.getStateChange () == ItemEvent.DESELECTED) { // TODO : } } }); speakerPanel.add (speakerMuteCheckBox); JLabel speakerMuteLabel = new JLabel (STRINGS.getString ("label.vojxta.mute")); gbc.fill = gbc.NONE; gbc.anchor = gbc.CENTER; gbc.gridx = 0; gbc.gridy = 3; gbc.insets = subComponentInsets; gbc.weightx = 1; gbc.weighty = .1; gbc.gridheight = 1; gbc.gridwidth = 1; speakerPanelLayout.setConstraints (speakerMuteLabel, gbc); speakerPanel.add (speakerMuteLabel); speakerLabel = new JLabel (STRINGS.getString ("label.vojxta.speaker")); gbc.fill = gbc.VERTICAL; gbc.anchor = gbc.CENTER; gbc.gridx = 0; gbc.gridy = 0; gbc.insets = subComponentInsets; gbc.weightx = 1; gbc.weighty = .1; gbc.gridheight = 1; gbc.gridwidth = 1; speakerPanelLayout.setConstraints (speakerLabel, gbc); speakerPanel.add (speakerLabel); // add subcomponentts to call control panel GridBagLayout callControlLayout = new GridBagLayout (); callControlPanel.setLayout (callControlLayout); startCallButton = new JButton (); gbc.fill = gbc.NONE; gbc.anchor = gbc.CENTER; gbc.gridx = 0; gbc.gridy = 0; gbc.insets = subComponentInsets; gbc.weightx = 1; gbc.weighty = 1; gbc.gridheight = 1; gbc.gridwidth = 1; if(isInitiatedLocally ()) { startCallButton.setText (STRINGS.getString ("action.vojxta.placecall")); startCallButton.setEnabled (true); }else{ startCallButton.setText (STRINGS.getString ("action.vojxta.acceptcall")); startCallButton.setEnabled (false); } startCallButton.addActionListener (new ActionListener () { public void actionPerformed (ActionEvent e) { localActionStartCall (); } }); callControlLayout.setConstraints (startCallButton, gbc); callControlPanel.add (startCallButton); holdCallButton = new JButton (STRINGS.getString ("action.vojxta.holdcall")); gbc.fill = gbc.NONE; gbc.anchor = gbc.CENTER; gbc.gridx = 0; gbc.gridy = 1; gbc.insets = subComponentInsets; gbc.weightx = 1; gbc.weighty = 1; gbc.gridheight = 1; gbc.gridwidth = 1; holdCallButton.setEnabled (false); holdCallButton.addActionListener (new ActionListener () { public void actionPerformed (ActionEvent e) { localActionHoldCall (); } }); callControlLayout.setConstraints (holdCallButton, gbc); callControlPanel.add (holdCallButton); endCallButton = new JButton (STRINGS.getString ("action.vojxta.endcall")); gbc.fill = gbc.NONE; gbc.anchor = gbc.CENTER; gbc.gridx = 0; gbc.gridy = 2; gbc.insets = subComponentInsets; gbc.weightx = 1; gbc.weighty = 1; gbc.gridheight = 1; gbc.gridwidth = 1; endCallButton.setEnabled (false); endCallButton.addActionListener (new ActionListener () { public void actionPerformed (ActionEvent e) { localActionEndCall (); } }); callControlLayout.setConstraints (endCallButton, gbc); callControlPanel.add (endCallButton); dismissButton = new JButton (STRINGS.getString ("action.dismiss")); gbc.fill = gbc.NONE; gbc.anchor = gbc.CENTER; gbc.gridx = 0; gbc.gridy = 3; gbc.insets = subComponentInsets; gbc.weightx = 1; gbc.weighty = 1; gbc.gridheight = 1; gbc.gridwidth = 1; dismissButton.setEnabled (false); dismissButton.addActionListener (new ActionListener () { public void actionPerformed (ActionEvent e) { localActionDismiss (); } }); callControlLayout.setConstraints (dismissButton, gbc); callControlPanel.add (dismissButton); configButton = new JButton (STRINGS.getString ("action.config")); gbc.fill = gbc.NONE; gbc.anchor = gbc.CENTER; gbc.gridx = 0; gbc.gridy = 3; gbc.insets = subComponentInsets; gbc.weightx = 1; gbc.weighty = 1; gbc.gridheight = 1; gbc.gridwidth = 1; configButton.setEnabled (true); configButton.setVisible (false); configButton.addActionListener (new ActionListener () { public void actionPerformed (ActionEvent e) { localActionShowPanel (CONFIG_PANEL); } }); callControlLayout.setConstraints (configButton, gbc); callControlPanel.add (configButton); statsButton = new JButton (STRINGS.getString ("action.vojxta.stats")); gbc.fill = gbc.NONE; gbc.anchor = gbc.CENTER; gbc.gridx = 0; gbc.gridy = 4; gbc.insets = subComponentInsets; gbc.weightx = 1; gbc.weighty = 1; gbc.gridheight = 1; gbc.gridwidth = 1; statsButton.setEnabled (true); statsButton.setVisible (true); statsButton.addActionListener (new ActionListener () { public void actionPerformed (ActionEvent e) { localActionShowPanel (STATS_PANEL); } }); callControlLayout.setConstraints (statsButton, gbc); callControlPanel.add (statsButton); JPanel configPanel = buildConfigPanel (); deckPanel.add (configPanel,this.CONFIG_PANEL); JScrollPane statsScrollPane = buildStatsPanel (); deckPanel.add (statsScrollPane,this.STATS_PANEL); cardLayout.show (deckPanel, this.CONFIG_PANEL); } /** * build the statistics panel */ private JScrollPane buildStatsPanel () { GridBagLayout gbl = new GridBagLayout (); GridBagConstraints gbc = new GridBagConstraints (); int gridY = 0; JPanel statsPanel = new JPanel (); statsPanel.setBorder(null); statsPanel.setLayout (gbl); JLabel label = null; JSeparator sep = null; JPanel trafficPanel = new JPanel();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -