|
|
|
|
@ -5,13 +5,13 @@
|
|
|
|
|
* See terms of license at gnu.org.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
package net.java.sip.communicator.impl.gui.main;
|
|
|
|
|
package net.java.sip.communicator.impl.gui.main.call;
|
|
|
|
|
|
|
|
|
|
import java.awt.*;
|
|
|
|
|
import java.awt.event.*;
|
|
|
|
|
|
|
|
|
|
import javax.swing.*;
|
|
|
|
|
|
|
|
|
|
import net.java.sip.communicator.impl.gui.customcontrols.*;
|
|
|
|
|
import net.java.sip.communicator.impl.gui.utils.*;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -25,53 +25,41 @@ public class DialPanel extends JPanel implements ActionListener {
|
|
|
|
|
|
|
|
|
|
private JComboBox phoneNumberCombo;
|
|
|
|
|
|
|
|
|
|
private SIPCommButton oneButton = new SIPCommButton(ImageLoader
|
|
|
|
|
.getImage(ImageLoader.ONE_DIAL_BUTTON),
|
|
|
|
|
SIPCommButton.LEFT_ICON_LAYOUT);
|
|
|
|
|
private JButton oneButton = new JButton(new ImageIcon(ImageLoader
|
|
|
|
|
.getImage(ImageLoader.ONE_DIAL_BUTTON)));
|
|
|
|
|
|
|
|
|
|
private SIPCommButton twoButton = new SIPCommButton(ImageLoader
|
|
|
|
|
.getImage(ImageLoader.TWO_DIAL_BUTTON),
|
|
|
|
|
SIPCommButton.LEFT_ICON_LAYOUT);
|
|
|
|
|
private JButton twoButton = new JButton(new ImageIcon(ImageLoader
|
|
|
|
|
.getImage(ImageLoader.TWO_DIAL_BUTTON)));
|
|
|
|
|
|
|
|
|
|
private SIPCommButton threeButton = new SIPCommButton(ImageLoader
|
|
|
|
|
.getImage(ImageLoader.THREE_DIAL_BUTTON),
|
|
|
|
|
SIPCommButton.LEFT_ICON_LAYOUT);
|
|
|
|
|
private JButton threeButton = new JButton(new ImageIcon(ImageLoader
|
|
|
|
|
.getImage(ImageLoader.THREE_DIAL_BUTTON)));
|
|
|
|
|
|
|
|
|
|
private SIPCommButton fourButton = new SIPCommButton(ImageLoader
|
|
|
|
|
.getImage(ImageLoader.FOUR_DIAL_BUTTON),
|
|
|
|
|
SIPCommButton.LEFT_ICON_LAYOUT);
|
|
|
|
|
private JButton fourButton = new JButton(new ImageIcon(ImageLoader
|
|
|
|
|
.getImage(ImageLoader.FOUR_DIAL_BUTTON)));
|
|
|
|
|
|
|
|
|
|
private SIPCommButton fiveButton = new SIPCommButton(ImageLoader
|
|
|
|
|
.getImage(ImageLoader.FIVE_DIAL_BUTTON),
|
|
|
|
|
SIPCommButton.LEFT_ICON_LAYOUT);
|
|
|
|
|
private JButton fiveButton = new JButton(new ImageIcon(ImageLoader
|
|
|
|
|
.getImage(ImageLoader.FIVE_DIAL_BUTTON)));
|
|
|
|
|
|
|
|
|
|
private SIPCommButton sixButton = new SIPCommButton(ImageLoader
|
|
|
|
|
.getImage(ImageLoader.SIX_DIAL_BUTTON),
|
|
|
|
|
SIPCommButton.LEFT_ICON_LAYOUT);
|
|
|
|
|
private JButton sixButton = new JButton(new ImageIcon(ImageLoader
|
|
|
|
|
.getImage(ImageLoader.SIX_DIAL_BUTTON)));
|
|
|
|
|
|
|
|
|
|
private SIPCommButton sevenButton = new SIPCommButton(ImageLoader
|
|
|
|
|
.getImage(ImageLoader.SEVEN_DIAL_BUTTON),
|
|
|
|
|
SIPCommButton.LEFT_ICON_LAYOUT);
|
|
|
|
|
private JButton sevenButton = new JButton(new ImageIcon(ImageLoader
|
|
|
|
|
.getImage(ImageLoader.SEVEN_DIAL_BUTTON)));
|
|
|
|
|
|
|
|
|
|
private SIPCommButton eightButton = new SIPCommButton(ImageLoader
|
|
|
|
|
.getImage(ImageLoader.EIGHT_DIAL_BUTTON),
|
|
|
|
|
SIPCommButton.LEFT_ICON_LAYOUT);
|
|
|
|
|
private JButton eightButton = new JButton(new ImageIcon(ImageLoader
|
|
|
|
|
.getImage(ImageLoader.EIGHT_DIAL_BUTTON)));
|
|
|
|
|
|
|
|
|
|
private SIPCommButton nineButton = new SIPCommButton(ImageLoader
|
|
|
|
|
.getImage(ImageLoader.NINE_DIAL_BUTTON),
|
|
|
|
|
SIPCommButton.LEFT_ICON_LAYOUT);
|
|
|
|
|
private JButton nineButton = new JButton(new ImageIcon(ImageLoader
|
|
|
|
|
.getImage(ImageLoader.NINE_DIAL_BUTTON)));
|
|
|
|
|
|
|
|
|
|
private SIPCommButton starButton = new SIPCommButton(ImageLoader
|
|
|
|
|
.getImage(ImageLoader.STAR_DIAL_BUTTON),
|
|
|
|
|
SIPCommButton.LEFT_ICON_LAYOUT);
|
|
|
|
|
private JButton starButton = new JButton(new ImageIcon(ImageLoader
|
|
|
|
|
.getImage(ImageLoader.STAR_DIAL_BUTTON)));
|
|
|
|
|
|
|
|
|
|
private SIPCommButton zeroButton = new SIPCommButton(ImageLoader
|
|
|
|
|
.getImage(ImageLoader.ZERO_DIAL_BUTTON),
|
|
|
|
|
SIPCommButton.LEFT_ICON_LAYOUT);
|
|
|
|
|
private JButton zeroButton = new JButton(new ImageIcon(ImageLoader
|
|
|
|
|
.getImage(ImageLoader.ZERO_DIAL_BUTTON)));
|
|
|
|
|
|
|
|
|
|
private SIPCommButton diezButton = new SIPCommButton(ImageLoader
|
|
|
|
|
.getImage(ImageLoader.DIEZ_DIAL_BUTTON),
|
|
|
|
|
SIPCommButton.LEFT_ICON_LAYOUT);
|
|
|
|
|
private JButton diezButton = new JButton(new ImageIcon(ImageLoader
|
|
|
|
|
.getImage(ImageLoader.DIEZ_DIAL_BUTTON)));
|
|
|
|
|
|
|
|
|
|
private JPanel dialPadPanel = new JPanel(new GridLayout(4, 3, 5, 5));
|
|
|
|
|
|
|
|
|
|
@ -90,6 +78,19 @@ public DialPanel() {
|
|
|
|
|
* Initializes this panel by adding all dial buttons to it.
|
|
|
|
|
*/
|
|
|
|
|
public void init() {
|
|
|
|
|
oneButton.setAlignmentY(JButton.LEFT_ALIGNMENT);
|
|
|
|
|
twoButton.setAlignmentY(JButton.LEFT_ALIGNMENT);
|
|
|
|
|
threeButton.setAlignmentY(JButton.LEFT_ALIGNMENT);
|
|
|
|
|
fourButton.setAlignmentY(JButton.LEFT_ALIGNMENT);
|
|
|
|
|
fiveButton.setAlignmentY(JButton.LEFT_ALIGNMENT);
|
|
|
|
|
sixButton.setAlignmentY(JButton.LEFT_ALIGNMENT);
|
|
|
|
|
sevenButton.setAlignmentY(JButton.LEFT_ALIGNMENT);
|
|
|
|
|
eightButton.setAlignmentY(JButton.LEFT_ALIGNMENT);
|
|
|
|
|
nineButton.setAlignmentY(JButton.LEFT_ALIGNMENT);
|
|
|
|
|
zeroButton.setAlignmentY(JButton.LEFT_ALIGNMENT);
|
|
|
|
|
diezButton.setAlignmentY(JButton.LEFT_ALIGNMENT);
|
|
|
|
|
starButton.setAlignmentY(JButton.LEFT_ALIGNMENT);
|
|
|
|
|
|
|
|
|
|
oneButton.setName("one");
|
|
|
|
|
twoButton.setName("two");
|
|
|
|
|
threeButton.setName("three");
|
|
|
|
|
@ -116,19 +117,6 @@ public void init() {
|
|
|
|
|
diezButton.addActionListener(this);
|
|
|
|
|
starButton.addActionListener(this);
|
|
|
|
|
|
|
|
|
|
oneButton.setFont(Constants.FONT);
|
|
|
|
|
twoButton.setFont(Constants.FONT);
|
|
|
|
|
threeButton.setFont(Constants.FONT);
|
|
|
|
|
fourButton.setFont(Constants.FONT);
|
|
|
|
|
fiveButton.setFont(Constants.FONT);
|
|
|
|
|
sixButton.setFont(Constants.FONT);
|
|
|
|
|
sevenButton.setFont(Constants.FONT);
|
|
|
|
|
eightButton.setFont(Constants.FONT);
|
|
|
|
|
nineButton.setFont(Constants.FONT);
|
|
|
|
|
zeroButton.setFont(Constants.FONT);
|
|
|
|
|
diezButton.setFont(Constants.FONT);
|
|
|
|
|
starButton.setFont(Constants.FONT);
|
|
|
|
|
|
|
|
|
|
dialPadPanel.add(oneButton);
|
|
|
|
|
dialPadPanel.add(twoButton);
|
|
|
|
|
dialPadPanel.add(threeButton);
|
|
|
|
|
@ -157,36 +145,54 @@ public void actionPerformed(ActionEvent e) {
|
|
|
|
|
if (this.phoneNumberCombo.getEditor().getItem() != null)
|
|
|
|
|
phoneNumber = (String) this.phoneNumberCombo.getEditor().getItem();
|
|
|
|
|
|
|
|
|
|
if (buttonName.equals("one"))
|
|
|
|
|
if (buttonName.equals("one")) {
|
|
|
|
|
SoundLoader.getSound(SoundLoader.DIAL_ONE).play();
|
|
|
|
|
this.phoneNumberCombo.getEditor().setItem(phoneNumber + "1");
|
|
|
|
|
|
|
|
|
|
else if (buttonName.equals("two"))
|
|
|
|
|
}
|
|
|
|
|
else if (buttonName.equals("two")) {
|
|
|
|
|
SoundLoader.getSound(SoundLoader.DIAL_TWO).play();
|
|
|
|
|
this.phoneNumberCombo.getEditor().setItem(phoneNumber + "2");
|
|
|
|
|
|
|
|
|
|
else if (buttonName.equals("three"))
|
|
|
|
|
}
|
|
|
|
|
else if (buttonName.equals("three")) {
|
|
|
|
|
SoundLoader.getSound(SoundLoader.DIAL_THREE).play();
|
|
|
|
|
this.phoneNumberCombo.getEditor().setItem(phoneNumber + "3");
|
|
|
|
|
|
|
|
|
|
else if (buttonName.equals("four"))
|
|
|
|
|
}
|
|
|
|
|
else if (buttonName.equals("four")) {
|
|
|
|
|
SoundLoader.getSound(SoundLoader.DIAL_FOUR).play();
|
|
|
|
|
this.phoneNumberCombo.getEditor().setItem(phoneNumber + "4");
|
|
|
|
|
|
|
|
|
|
else if (buttonName.equals("five"))
|
|
|
|
|
}
|
|
|
|
|
else if (buttonName.equals("five")) {
|
|
|
|
|
SoundLoader.getSound(SoundLoader.DIAL_FIVE).play();
|
|
|
|
|
this.phoneNumberCombo.getEditor().setItem(phoneNumber + "5");
|
|
|
|
|
|
|
|
|
|
else if (buttonName.equals("six"))
|
|
|
|
|
}
|
|
|
|
|
else if (buttonName.equals("six")) {
|
|
|
|
|
SoundLoader.getSound(SoundLoader.DIAL_SIX).play();
|
|
|
|
|
this.phoneNumberCombo.getEditor().setItem(phoneNumber + "6");
|
|
|
|
|
|
|
|
|
|
else if (buttonName.equals("seven"))
|
|
|
|
|
}
|
|
|
|
|
else if (buttonName.equals("seven")) {
|
|
|
|
|
SoundLoader.getSound(SoundLoader.DIAL_SEVEN).play();
|
|
|
|
|
this.phoneNumberCombo.getEditor().setItem(phoneNumber + "7");
|
|
|
|
|
|
|
|
|
|
else if (buttonName.equals("eight"))
|
|
|
|
|
}
|
|
|
|
|
else if (buttonName.equals("eight")) {
|
|
|
|
|
SoundLoader.getSound(SoundLoader.DIAL_EIGHT).play();
|
|
|
|
|
this.phoneNumberCombo.getEditor().setItem(phoneNumber + "8");
|
|
|
|
|
|
|
|
|
|
else if (buttonName.equals("nine"))
|
|
|
|
|
}
|
|
|
|
|
else if (buttonName.equals("nine")) {
|
|
|
|
|
SoundLoader.getSound(SoundLoader.DIAL_NINE).play();
|
|
|
|
|
this.phoneNumberCombo.getEditor().setItem(phoneNumber + "9");
|
|
|
|
|
|
|
|
|
|
else if (buttonName.equals("zero"))
|
|
|
|
|
}
|
|
|
|
|
else if (buttonName.equals("zero")) {
|
|
|
|
|
SoundLoader.getSound(SoundLoader.DIAL_ZERO).play();
|
|
|
|
|
this.phoneNumberCombo.getEditor().setItem(phoneNumber + "0");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (buttonName.equals("diez")) {
|
|
|
|
|
SoundLoader.getSound(SoundLoader.DIAL_DIEZ).play();
|
|
|
|
|
this.phoneNumberCombo.getEditor().setItem(phoneNumber + "#");
|
|
|
|
|
}
|
|
|
|
|
else if (buttonName.equals("star")) {
|
|
|
|
|
SoundLoader.getSound(SoundLoader.DIAL_STAR).play();
|
|
|
|
|
this.phoneNumberCombo.getEditor().setItem(phoneNumber + "*");
|
|
|
|
|
}
|
|
|
|
|
this.phoneNumberCombo.requestFocus();
|
|
|
|
|
}
|
|
|
|
|
|