use of org.jivesoftware.sparkplugin.components.RedialButton in project Spark by igniterealtime.
the class NonRosterPanel method buildMiddlePanel.
/**
* Builds the Control Panel.
*
* @return the control panel.
*/
private JPanel buildMiddlePanel() {
// Add Control Panel
final JPanel mainPanel = new JPanel(new GridBagLayout()) {
private static final long serialVersionUID = 1571929852761037052L;
public Dimension getPreferredSize() {
final Dimension dim = super.getPreferredSize();
dim.height = 100;
return dim;
}
};
mainPanel.setOpaque(false);
// Add Input Volume To Control Panel
try {
final ControlPanel inputPanel = new ControlPanel(new GridBagLayout());
final JLabel inputIcon = new JLabel(PhoneRes.getImageIcon("MICROPHONE_IMAGE"));
inputPanel.add(mixer.getPrefferedInputVolume(), new GridBagConstraints(0, 0, 1, 1, 0.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.VERTICAL, new Insets(2, 2, 2, 2), 0, 0));
inputPanel.add(inputIcon, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(2, 2, 2, 2), 0, 0));
mainPanel.add(inputPanel, new GridBagConstraints(0, 0, 1, 1, 0.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(2, 1, 2, 1), 0, 0));
} catch (Exception e) {
Log.error(e);
}
try {
// Add Output Volume To Control Panel
final ControlPanel outputPanel = new ControlPanel(new GridBagLayout());
final JLabel outputIcon = new JLabel(PhoneRes.getImageIcon("SPEAKER_IMAGE"));
Component component = mixer.getPrefferedMasterVolume();
if (component != null)
outputPanel.add(component, new GridBagConstraints(0, 0, 1, 1, 0.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.VERTICAL, new Insets(2, 2, 2, 2), 0, 0));
outputPanel.add(outputIcon, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(2, 2, 2, 2), 0, 0));
mainPanel.add(outputPanel, new GridBagConstraints(1, 0, 1, 1, 0.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(2, 1, 2, 5), 0, 0));
} catch (Exception e) {
Log.error(e);
}
// Build ControlPanel List
final JPanel controlPanel = new JPanel(new GridBagLayout());
controlPanel.setOpaque(false);
muteButton = new CallPanelButton(PhoneRes.getImageIcon("MUTE_IMAGE").getImage(), PhoneRes.getIString("phone.mute"));
muteButton.setToolTipText(PhoneRes.getIString("phone.tips.mute"));
controlPanel.add(muteButton, new GridBagConstraints(0, 0, 1, 1, 0.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
holdButton = new CallPanelButton(PhoneRes.getImageIcon("ON_HOLD_IMAGE").getImage(), PhoneRes.getIString("phone.hold"));
holdButton.setToolTipText(PhoneRes.getIString("phone.tips.hold"));
controlPanel.add(holdButton, new GridBagConstraints(1, 0, 1, 1, 0.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
transferButton = new CallPanelButton(PhoneRes.getImageIcon("TRANSFER_IMAGE").getImage(), PhoneRes.getIString("phone.transfer"));
transferButton.setToolTipText(PhoneRes.getIString("phone.tips.transfer"));
controlPanel.add(transferButton, new GridBagConstraints(2, 0, 1, 1, 0.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
// Add End Call button
hangUpButton = new EndCallButton();
redialButton = new RedialButton();
redialButton.setVisible(false);
// Add Components to Main Panel
mainPanel.add(controlPanel, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 1, 2, 1), 0, 0));
mainPanel.add(hangUpButton, new GridBagConstraints(3, 0, 1, 1, 1.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 1, 2, 1), 0, 0));
mainPanel.add(redialButton, new GridBagConstraints(3, 0, 1, 1, 1.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 1, 2, 1), 0, 0));
return mainPanel;
}
Aggregations