Search in sources :

Example 1 with PhonePad

use of org.jivesoftware.sparkplugin.ui.PhonePad in project Spark by igniterealtime.

the class RosterMemberPanel method buildTopPanel.

/**
 * Builds the information block.
 *
 * @return the UI representing the Information Block.
 */
private JPanel buildTopPanel() {
    final JPanel panel = new JPanel(new GridBagLayout());
    panel.setOpaque(false);
    // Add phone label
    phoneLabel = new JLabel();
    phoneLabel.setFont(new Font("Arial", Font.BOLD, 13));
    phoneLabel.setForeground(new Color(64, 103, 162));
    panel.add(phoneLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 2, 2, 2), 0, 0));
    // Add Dial Pad
    final RolloverButton dialPadButton = new RolloverButton(PhoneRes.getImageIcon("ICON_NUMBERPAD_IMAGE"));
    panel.add(dialPadButton, new GridBagConstraints(1, 0, 1, 3, 1.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(0, 2, 2, 2), 0, 0));
    final PhonePad pad = new PhonePad();
    dialPadButton.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent actionEvent) {
            pad.showDialpad(dialPadButton, true);
        }
    });
    // Add Connected Label
    connectedLabel = new JLabel(CONNECTED);
    connectedLabel.setFont(new Font("Arial", Font.BOLD, 13));
    connectedLabel.setHorizontalTextPosition(JLabel.CENTER);
    connectedLabel.setHorizontalAlignment(JLabel.CENTER);
    panel.add(connectedLabel, new GridBagConstraints(0, 1, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 0, 0));
    return panel;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) Color(java.awt.Color) PhonePad(org.jivesoftware.sparkplugin.ui.PhonePad) JLabel(javax.swing.JLabel) RolloverButton(org.jivesoftware.spark.component.RolloverButton) Font(java.awt.Font)

Example 2 with PhonePad

use of org.jivesoftware.sparkplugin.ui.PhonePad in project Spark by igniterealtime.

the class NonRosterPanel method buildDefaultUI.

private void buildDefaultUI() {
    // Add Top Panel
    final JPanel topPanel = buildTopPanel();
    add(topPanel, new GridBagConstraints(0, 0, 2, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
    // Build Control Panel
    final JPanel middlePanel = buildMiddlePanel();
    add(middlePanel, new GridBagConstraints(0, 6, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
    // Build Bottom Panel
    final PhonePad phonePad = new PhonePad();
    historyPanel = new PreviousConversationPanel();
    add(phonePad, new GridBagConstraints(0, 8, 1, 1, 0.0, 0.9, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
    add(historyPanel, new GridBagConstraints(1, 8, 1, 1, 1.0, 0.9, GridBagConstraints.NORTH, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0));
    // Setup default settings
    setupDefaults();
    uiBuilt = true;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) PhonePad(org.jivesoftware.sparkplugin.ui.PhonePad)

Aggregations

GridBagConstraints (java.awt.GridBagConstraints)2 Insets (java.awt.Insets)2 JPanel (javax.swing.JPanel)2 PhonePad (org.jivesoftware.sparkplugin.ui.PhonePad)2 Color (java.awt.Color)1 Font (java.awt.Font)1 GridBagLayout (java.awt.GridBagLayout)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 JLabel (javax.swing.JLabel)1 RolloverButton (org.jivesoftware.spark.component.RolloverButton)1