aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/impl/gui/main/CallReceivePanel.java
blob: 401858b52f96022177981ca9b514f2b84850a4d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*
 * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */

package net.java.sip.communicator.impl.gui.main;

import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Image;

import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.ImageIcon;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;

import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommButton;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;

/**
 * @author Yana Stamcheva
 */
public class CallReceivePanel extends JDialog {

    private Image callButtonBG = ImageLoader
            .getImage(ImageLoader.CALL_BUTTON_BG);

    private Image callButtonRolloverBG = ImageLoader
            .getImage(ImageLoader.CALL_ROLLOVER_BUTTON_BG);

    private Image hangupButtonBG = ImageLoader
            .getImage(ImageLoader.HANGUP_BUTTON_BG);

    private Image hangupButtonRolloverBG = ImageLoader
            .getImage(ImageLoader.HANGUP_ROLLOVER_BUTTON_BG);

    private JLabel personPhoto = new JLabel(new ImageIcon(ImageLoader
            .getImage(ImageLoader.DEFAULT_USER_PHOTO)));

    private JLabel personName = new JLabel("John Smith");

    private JLabel birthDate = new JLabel("11/11/1900");

    private JLabel emptyLabel = new JLabel("  ");

    private JLabel personInfo = new JLabel("additional info");

    private SIPCommButton callButton;

    private SIPCommButton hangupButton;

    private JPanel userInfoPanel = new JPanel();

    private JPanel buttonsPanel = new JPanel(new FlowLayout(FlowLayout.CENTER,
            15, 5));

    public CallReceivePanel(MainFrame parent) {

        super(parent);

        this.setSize(300, 200);

        this.getContentPane().setLayout(new BorderLayout());

        callButton = new SIPCommButton(callButtonBG, callButtonRolloverBG);

        hangupButton = new SIPCommButton(
                hangupButtonBG, hangupButtonRolloverBG);

        this.init();
    }

    public void init() {
        this.personName.setFont(new Font("Sans Serif", Font.BOLD, 12));

        // this.buttonsPanel.setBorder(BorderFactory.createMatteBorder(1, 0, 0,
        // 0, Color.GRAY));
        this.buttonsPanel.add(callButton);
        this.buttonsPanel.add(hangupButton);

        this.userInfoPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0,
                0));
        this.userInfoPanel.setLayout(new BoxLayout(userInfoPanel,
                BoxLayout.Y_AXIS));

        this.userInfoPanel.add(personName);
        this.userInfoPanel.add(birthDate);
        this.userInfoPanel.add(emptyLabel);
        this.userInfoPanel.add(personInfo);

        this.getContentPane().add(personPhoto, BorderLayout.WEST);
        this.getContentPane().add(userInfoPanel, BorderLayout.CENTER);
        this.getContentPane().add(buttonsPanel, BorderLayout.SOUTH);
    }
}