|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
@ -0,0 +1,62 @@
|
||||
/*
|
||||
* 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.*;
|
||||
import java.awt.event.*;
|
||||
|
||||
import net.java.sip.communicator.impl.gui.utils.*;
|
||||
import net.java.sip.communicator.util.swing.*;
|
||||
|
||||
/**
|
||||
* The dial pad button in the contact list.
|
||||
*
|
||||
* @author Yana Stamcheva
|
||||
*/
|
||||
public class DialPadButton
|
||||
extends SIPCommTextButton
|
||||
{
|
||||
/**
|
||||
* The dial pad dialog that this button opens.
|
||||
*/
|
||||
GeneralDialPadDialog dialPad;
|
||||
|
||||
/**
|
||||
* Creates an instance of <tt>DialPadButton</tt>.
|
||||
*/
|
||||
public DialPadButton()
|
||||
{
|
||||
super("");
|
||||
|
||||
loadSkin();
|
||||
|
||||
addActionListener(new ActionListener()
|
||||
{
|
||||
public void actionPerformed(ActionEvent e)
|
||||
{
|
||||
if (dialPad == null)
|
||||
dialPad = new GeneralDialPadDialog();
|
||||
|
||||
dialPad.clear();
|
||||
dialPad.setVisible(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads images and sets history view.
|
||||
*/
|
||||
public void loadSkin()
|
||||
{
|
||||
Image image = ImageLoader.getImage(ImageLoader.CONTACT_LIST_DIAL_BUTTON);
|
||||
|
||||
setBgImage(image);
|
||||
|
||||
this.setPreferredSize(new Dimension(image.getWidth(this),
|
||||
image.getHeight(this)));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,93 @@
|
||||
/*
|
||||
* 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.*;
|
||||
|
||||
import net.java.sip.communicator.util.*;
|
||||
import net.java.sip.communicator.util.skin.*;
|
||||
import net.java.sip.communicator.util.swing.*;
|
||||
import net.java.sip.communicator.util.swing.plaf.*;
|
||||
|
||||
/**
|
||||
* The <tt>SearchTextFieldUI</tt> is the one responsible for the search field
|
||||
* look & feel. It draws a search icon inside the field and adjusts the bounds
|
||||
* of the editor rectangle according to it.
|
||||
*
|
||||
* @author Yana Stamcheva
|
||||
* @author Adam Netocny
|
||||
*/
|
||||
public class DialPadFieldUI
|
||||
extends SIPCommTextFieldUI
|
||||
implements Skinnable
|
||||
{
|
||||
/**
|
||||
* Creates a <tt>SIPCommTextFieldUI</tt>.
|
||||
*/
|
||||
public DialPadFieldUI()
|
||||
{
|
||||
loadSkin();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the custom mouse listeners defined in this class to the installed
|
||||
* listeners.
|
||||
*/
|
||||
protected void installListeners()
|
||||
{
|
||||
super.installListeners();
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements parent paintSafely method and enables antialiasing.
|
||||
* @param g the <tt>Graphics</tt> object that notified us
|
||||
*/
|
||||
protected void paintSafely(Graphics g)
|
||||
{
|
||||
customPaintBackground(g);
|
||||
super.paintSafely(g);
|
||||
}
|
||||
|
||||
/**
|
||||
* Paints the background of the associated component.
|
||||
* @param g the <tt>Graphics</tt> object used for painting
|
||||
*/
|
||||
protected void customPaintBackground(Graphics g)
|
||||
{
|
||||
Graphics2D g2 = (Graphics2D) g.create();
|
||||
|
||||
try
|
||||
{
|
||||
AntialiasingManager.activateAntialiasing(g2);
|
||||
super.customPaintBackground(g2);
|
||||
}
|
||||
finally
|
||||
{
|
||||
g2.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* If we are in the case of disabled delete button, we simply call the
|
||||
* parent implementation of this method, otherwise we recalculate the editor
|
||||
* rectangle in order to leave place for the delete button.
|
||||
* @return the visible editor rectangle
|
||||
*/
|
||||
protected Rectangle getVisibleEditorRect()
|
||||
{
|
||||
Rectangle rect = super.getVisibleEditorRect();
|
||||
|
||||
if ((rect.width > 0) && (rect.height > 0))
|
||||
{
|
||||
rect.x += 8;
|
||||
rect.width -= 18;
|
||||
|
||||
return rect;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,320 @@
|
||||
/*
|
||||
* 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.*;
|
||||
import java.awt.event.*;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
import net.java.sip.communicator.impl.gui.*;
|
||||
import net.java.sip.communicator.impl.gui.main.call.*;
|
||||
import net.java.sip.communicator.impl.gui.utils.*;
|
||||
import net.java.sip.communicator.util.*;
|
||||
import net.java.sip.communicator.util.skin.*;
|
||||
import net.java.sip.communicator.util.swing.*;
|
||||
import net.java.sip.communicator.util.swing.plaf.*;
|
||||
|
||||
import com.explodingpixels.macwidgets.*;
|
||||
|
||||
/**
|
||||
* The <tt>DialpadDialog</tt> is a popup dialog containing a dialpad.
|
||||
*
|
||||
* @author Yana Stamcheva
|
||||
*/
|
||||
public class GeneralDialPadDialog
|
||||
{
|
||||
/**
|
||||
* The call field, where the dialed number is typed.
|
||||
*/
|
||||
private final JTextField callField;
|
||||
|
||||
/**
|
||||
* The actual dial pad dialog.
|
||||
*/
|
||||
private final JDialog dialPadDialog;
|
||||
|
||||
/**
|
||||
* The call button.
|
||||
*/
|
||||
private JButton callButton;
|
||||
|
||||
/**
|
||||
* A keyboard manager, where we register our own key dispatcher.
|
||||
*/
|
||||
private KeyboardFocusManager keyManager;
|
||||
|
||||
/**
|
||||
* A key dispatcher that redirects all key events to call field.
|
||||
*/
|
||||
private KeyEventDispatcher keyDispatcher;
|
||||
|
||||
/**
|
||||
* Creates an instance of <tt>GeneralDialPadDialog</tt>.
|
||||
*/
|
||||
public GeneralDialPadDialog()
|
||||
{
|
||||
if (OSUtils.IS_MAC)
|
||||
{
|
||||
HudWindow window = new HudWindow();
|
||||
|
||||
dialPadDialog = window.getJDialog();
|
||||
}
|
||||
else
|
||||
{
|
||||
dialPadDialog = new SIPCommDialog(false);
|
||||
}
|
||||
|
||||
callField = new CallField(GuiActivator.getResources()
|
||||
.getI18NString("service.gui.ENTER_NAME_OR_NUMBER"));
|
||||
|
||||
dialPadDialog.setTitle(
|
||||
GuiActivator.getResources().getI18NString("service.gui.DIALPAD"));
|
||||
|
||||
JPanel mainPanel = new TransparentPanel(new BorderLayout());
|
||||
|
||||
mainPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
|
||||
|
||||
mainPanel.add(callField, BorderLayout.NORTH);
|
||||
DTMFHandler dtmfHandler = new DTMFHandler();
|
||||
dtmfHandler.addParent(dialPadDialog);
|
||||
mainPanel.add(new GeneralDialPanel(this, dtmfHandler));
|
||||
mainPanel.add(createCallPanel(), BorderLayout.SOUTH);
|
||||
|
||||
dialPadDialog.add(mainPanel);
|
||||
dialPadDialog.pack();
|
||||
|
||||
dialPadDialog.addWindowListener(new WindowAdapter()
|
||||
{
|
||||
public void windowOpened(WindowEvent e)
|
||||
{
|
||||
if (keyManager == null)
|
||||
{
|
||||
keyManager
|
||||
= KeyboardFocusManager.getCurrentKeyboardFocusManager();
|
||||
|
||||
keyDispatcher = new MainKeyDispatcher(keyManager);
|
||||
}
|
||||
|
||||
keyManager.addKeyEventDispatcher(
|
||||
new MainKeyDispatcher(keyManager));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowClosed(WindowEvent e)
|
||||
{
|
||||
if (keyManager != null)
|
||||
keyManager.removeKeyEventDispatcher(keyDispatcher);
|
||||
|
||||
keyManager = null;
|
||||
keyDispatcher = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the call panel.
|
||||
*
|
||||
* @return the created call panel.
|
||||
*/
|
||||
private JComponent createCallPanel()
|
||||
{
|
||||
JPanel buttonsPanel
|
||||
= new TransparentPanel(new FlowLayout(FlowLayout.CENTER));
|
||||
|
||||
Image callButtonImage
|
||||
= ImageLoader.getImage(ImageLoader.DIAL_PAD_CALL_BUTTON_BG);
|
||||
|
||||
callButton = new SIPCommTextButton(
|
||||
GuiActivator.getResources().getI18NString("service.gui.CALL"),
|
||||
callButtonImage);
|
||||
|
||||
callButton.setPreferredSize(new Dimension(
|
||||
callButtonImage.getWidth(null),
|
||||
callButtonImage.getHeight(null)));
|
||||
|
||||
callButton.setForeground(Color.WHITE);
|
||||
|
||||
callButton.addActionListener(new ActionListener()
|
||||
{
|
||||
public void actionPerformed(ActionEvent e)
|
||||
{
|
||||
CallManager.createCall(callField.getText(), callButton,
|
||||
new CallInterfaceListener()
|
||||
{
|
||||
public void callInterfaceStarted()
|
||||
{
|
||||
dialPadDialog.setVisible(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
buttonsPanel.add(callButton);
|
||||
|
||||
dialPadDialog.getRootPane().setDefaultButton(callButton);
|
||||
|
||||
return buttonsPanel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates that a dial button was pressed.
|
||||
*
|
||||
* @param s the string corresponding to a number to add to the call field
|
||||
*/
|
||||
public void dialButtonPressed(String s)
|
||||
{
|
||||
callField.setText(callField.getText() + s);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows/hides the dial pad dialog.
|
||||
*
|
||||
* @param visible indicates if the dial pad should be shown or hidden.
|
||||
*/
|
||||
public void setVisible(boolean visible)
|
||||
{
|
||||
dialPadDialog.setLocationRelativeTo(
|
||||
GuiActivator.getUIService().getMainFrame());
|
||||
dialPadDialog.setVisible(visible);
|
||||
callField.requestFocus();
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the call field.
|
||||
*/
|
||||
public void clear()
|
||||
{
|
||||
callField.setText("");
|
||||
}
|
||||
|
||||
/**
|
||||
* The <tt>MainKeyDispatcher</tt> is added to pre-listen KeyEvents before
|
||||
* they're delivered to the current focus owner in order to introduce a
|
||||
* specific behavior for the <tt>CallField</tt> on top of the dial pad.
|
||||
*/
|
||||
private class MainKeyDispatcher implements KeyEventDispatcher
|
||||
{
|
||||
private KeyboardFocusManager keyManager;
|
||||
|
||||
/**
|
||||
* Creates an instance of <tt>MainKeyDispatcher</tt>.
|
||||
* @param keyManager the parent <tt>KeyboardFocusManager</tt>
|
||||
*/
|
||||
public MainKeyDispatcher(KeyboardFocusManager keyManager)
|
||||
{
|
||||
this.keyManager = keyManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispatches the given <tt>KeyEvent</tt>.
|
||||
* @param e the <tt>KeyEvent</tt> to dispatch
|
||||
* @return <tt>true</tt> if the KeyboardFocusManager should take no
|
||||
* further action with regard to the KeyEvent; <tt>false</tt>
|
||||
* otherwise
|
||||
*/
|
||||
public boolean dispatchKeyEvent(KeyEvent e)
|
||||
{
|
||||
// If this window is not the focus window or if the event is not
|
||||
// of type PRESSED we have nothing more to do here.
|
||||
if (!dialPadDialog.isFocused()
|
||||
|| (e.getID() != KeyEvent.KEY_TYPED))
|
||||
return false;
|
||||
|
||||
if (e.getKeyChar() == KeyEvent.CHAR_UNDEFINED
|
||||
|| e.getKeyCode() == KeyEvent.VK_ENTER
|
||||
|| e.getKeyCode() == KeyEvent.VK_DELETE
|
||||
|| e.getKeyCode() == KeyEvent.VK_BACK_SPACE
|
||||
|| e.getKeyCode() == KeyEvent.VK_TAB
|
||||
|| e.getKeyCode() == KeyEvent.VK_SPACE)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!callField.isFocusOwner()
|
||||
&& keyManager.getFocusOwner() != null)
|
||||
{
|
||||
// Request the focus in the call field if a letter is typed.
|
||||
callField.requestFocusInWindow();
|
||||
|
||||
// We re-dispatch the event to call field.
|
||||
keyManager.redispatchEvent(callField, e);
|
||||
|
||||
// We don't want to dispatch further this event.
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A custom call field.
|
||||
*/
|
||||
private class CallField
|
||||
extends SIPCommTextField
|
||||
implements Skinnable
|
||||
{
|
||||
/**
|
||||
* The text field ui.
|
||||
*/
|
||||
private SIPCommTextFieldUI textFieldUI;
|
||||
|
||||
/**
|
||||
* Creates an instance of the <tt>CallField</tt>.
|
||||
*/
|
||||
public CallField(String text)
|
||||
{
|
||||
super(text);
|
||||
|
||||
textFieldUI = new DialPadFieldUI();
|
||||
textFieldUI.setDeleteButtonEnabled(true);
|
||||
|
||||
this.setPreferredSize(new Dimension(200, 23));
|
||||
this.setUI(textFieldUI);
|
||||
this.setBorder(null);
|
||||
this.setOpaque(false);
|
||||
|
||||
this.setDragEnabled(true);
|
||||
|
||||
InputMap imap
|
||||
= getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
|
||||
imap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "escape");
|
||||
ActionMap amap = getActionMap();
|
||||
amap.put("escape", new AbstractAction()
|
||||
{
|
||||
public void actionPerformed(ActionEvent e)
|
||||
{
|
||||
setText("");
|
||||
}
|
||||
});
|
||||
|
||||
loadSkin();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reloads text field UI defs.
|
||||
*/
|
||||
public void loadSkin()
|
||||
{
|
||||
textFieldUI.loadSkin();
|
||||
|
||||
if (OSUtils.IS_MAC)
|
||||
{
|
||||
textFieldUI.setBgStartColor(Color.BLACK);
|
||||
textFieldUI.setBgEndColor(Color.BLACK);
|
||||
textFieldUI.setBgBorderStartColor(Color.DARK_GRAY);
|
||||
textFieldUI.setBgBorderEndColor(Color.GRAY);
|
||||
|
||||
setForegroundColor(Color.WHITE);
|
||||
setDefaultTextColor(Color.GRAY);
|
||||
|
||||
setCaretColor(Color.WHITE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,244 @@
|
||||
/*
|
||||
* 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.*;
|
||||
import java.awt.event.*;
|
||||
import java.awt.image.*;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
import net.java.sip.communicator.impl.gui.*;
|
||||
import net.java.sip.communicator.impl.gui.main.call.*;
|
||||
import net.java.sip.communicator.impl.gui.utils.*;
|
||||
import net.java.sip.communicator.service.resources.*;
|
||||
import net.java.sip.communicator.util.*;
|
||||
import net.java.sip.communicator.util.skin.*;
|
||||
import net.java.sip.communicator.util.swing.*;
|
||||
|
||||
/**
|
||||
* The <tt>DialPanel</tt> is the panel that contains the buttons to dial a
|
||||
* phone number.
|
||||
*
|
||||
* @author Yana Stamcheva
|
||||
* @author Adam Netocny
|
||||
*/
|
||||
public class GeneralDialPanel
|
||||
extends TransparentPanel
|
||||
implements MouseListener,
|
||||
Skinnable
|
||||
{
|
||||
/**
|
||||
* The dial panel.
|
||||
*/
|
||||
private final JPanel dialPadPanel =
|
||||
new TransparentPanel(new GridLayout(4, 3,
|
||||
GuiActivator.getResources()
|
||||
.getSettingsInt("impl.gui.DIAL_PAD_HORIZONTAL_GAP"),
|
||||
GuiActivator.getResources()
|
||||
.getSettingsInt("impl.gui.DIAL_PAD_VERTICAL_GAP")));
|
||||
|
||||
/**
|
||||
* Handles DTMFs.
|
||||
*/
|
||||
private DTMFHandler dtmfHandler;
|
||||
|
||||
/**
|
||||
* The parent dial pad dialog.
|
||||
*/
|
||||
private final GeneralDialPadDialog dialPadDialog;
|
||||
|
||||
/**
|
||||
* Creates an instance of <tt>DialPanel</tt> for a specific call, by
|
||||
* specifying the parent <tt>CallManager</tt> and the
|
||||
* <tt>CallPeer</tt>.
|
||||
*
|
||||
* @param dtmfHandler handles DTMFs.
|
||||
*/
|
||||
public GeneralDialPanel(GeneralDialPadDialog dialPadDialog,
|
||||
DTMFHandler dtmfHandler)
|
||||
{
|
||||
this.dialPadDialog = dialPadDialog;
|
||||
this.dtmfHandler = dtmfHandler;
|
||||
|
||||
this.init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes this panel by adding all dial buttons to it.
|
||||
*/
|
||||
public void init()
|
||||
{
|
||||
this.dialPadPanel.setOpaque(false);
|
||||
|
||||
this.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
|
||||
|
||||
loadSkin();
|
||||
|
||||
this.add(dialPadPanel, BorderLayout.CENTER);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates DTMF button.
|
||||
*
|
||||
* @param bgImage
|
||||
* @param iconImage
|
||||
* @param name
|
||||
* @return the created dial button
|
||||
*/
|
||||
private JButton createDialButton(Image bgImage, ImageID iconImage,
|
||||
String name)
|
||||
{
|
||||
JButton button =
|
||||
new SIPCommButton(bgImage, ImageLoader.getImage(iconImage));
|
||||
|
||||
button.setAlignmentY(JButton.LEFT_ALIGNMENT);
|
||||
button.setName(name);
|
||||
button.setOpaque(false);
|
||||
button.addMouseListener(this);
|
||||
return button;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates DTMF button.
|
||||
*
|
||||
* @param bgImage
|
||||
* @param iconImage
|
||||
* @param name
|
||||
* @return the created dial button
|
||||
*/
|
||||
private JButton createMacOSXDialButton( ImageID imageID,
|
||||
ImageID rolloverImageID,
|
||||
String name)
|
||||
{
|
||||
JButton button = new SIPCommButton(
|
||||
ImageLoader.getImage(imageID),
|
||||
ImageLoader.getImage(rolloverImageID),
|
||||
ImageLoader.getImage(rolloverImageID),
|
||||
null,
|
||||
null,
|
||||
null);
|
||||
|
||||
button.setName(name);
|
||||
button.addMouseListener(this);
|
||||
|
||||
return button;
|
||||
}
|
||||
|
||||
public void mouseClicked(MouseEvent e) {}
|
||||
|
||||
public void mouseEntered(MouseEvent e) {}
|
||||
|
||||
public void mouseExited(MouseEvent e) {}
|
||||
|
||||
/**
|
||||
* Handles the <tt>MouseEvent</tt> triggered when user presses one of the
|
||||
* dial buttons.
|
||||
* @param e the event
|
||||
*/
|
||||
public void mousePressed(MouseEvent e)
|
||||
{
|
||||
JButton button = (JButton) e.getSource();
|
||||
|
||||
dialPadDialog.dialButtonPressed(button.getName());
|
||||
dtmfHandler.startSendingDtmfTone(button.getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the <tt>MouseEvent</tt> triggered when user releases one of the
|
||||
* dial buttons.
|
||||
* @param e the event
|
||||
*/
|
||||
public void mouseReleased(MouseEvent e)
|
||||
{
|
||||
dtmfHandler.stopSendingDtmfTone();
|
||||
}
|
||||
|
||||
/**
|
||||
* Paints the main background image to the background of this dial panel.
|
||||
*
|
||||
* @param g the <tt>Graphics</tt> object used for painting
|
||||
*/
|
||||
public void paintComponent(Graphics g)
|
||||
{
|
||||
// do the superclass behavior first
|
||||
super.paintComponent(g);
|
||||
|
||||
Graphics2D g2 = (Graphics2D) g;
|
||||
|
||||
boolean isTextureBackground
|
||||
= Boolean.parseBoolean(GuiActivator.getResources()
|
||||
.getSettingsString("impl.gui.IS_CONTACT_LIST_TEXTURE_BG_ENABLED"));
|
||||
|
||||
BufferedImage bgImage
|
||||
= ImageLoader.getImage(ImageLoader.MAIN_WINDOW_BACKGROUND);
|
||||
|
||||
// paint the image
|
||||
if (bgImage != null)
|
||||
{
|
||||
if (isTextureBackground)
|
||||
{
|
||||
Rectangle rect
|
||||
= new Rectangle(0, 0,
|
||||
bgImage.getWidth(null),
|
||||
bgImage.getHeight(null));
|
||||
|
||||
TexturePaint texture = new TexturePaint(bgImage, rect);
|
||||
|
||||
g2.setPaint(texture);
|
||||
|
||||
g2.fillRect(0, 0, this.getWidth(), this.getHeight());
|
||||
}
|
||||
else
|
||||
{
|
||||
g.setColor(new Color(
|
||||
GuiActivator.getResources()
|
||||
.getColor("contactListBackground")));
|
||||
|
||||
// paint the background with the choosen color
|
||||
g.fillRect(0, 0, getWidth(), getHeight());
|
||||
|
||||
g2.drawImage(bgImage,
|
||||
this.getWidth() - bgImage.getWidth(),
|
||||
this.getHeight() - bgImage.getHeight(),
|
||||
this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reloads dial buttons.
|
||||
*/
|
||||
public void loadSkin()
|
||||
{
|
||||
dialPadPanel.removeAll();
|
||||
|
||||
Image bgImage = ImageLoader.getImage(ImageLoader.DIAL_BUTTON_BG);
|
||||
|
||||
DTMFHandler.DTMFToneInfo[] availableTones = DTMFHandler.availableTones;
|
||||
for (int i = 0; i < availableTones.length; i++)
|
||||
{
|
||||
DTMFHandler.DTMFToneInfo info = availableTones[i];
|
||||
|
||||
// we add only buttons having image
|
||||
if(info.imageID == null)
|
||||
continue;
|
||||
|
||||
JComponent c;
|
||||
if (OSUtils.IS_MAC)
|
||||
c = createMacOSXDialButton(
|
||||
info.macImageID,
|
||||
info.macImageRolloverID,
|
||||
info.tone.getValue());
|
||||
else
|
||||
c = createDialButton(
|
||||
bgImage, info.imageID, info.tone.getValue());
|
||||
|
||||
dialPadPanel.add(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* 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.call;
|
||||
|
||||
/**
|
||||
* The <tt>CallInterfaceListener</tt> is notified when the call interface has
|
||||
* been started after the call was created.
|
||||
*
|
||||
* @author Yana Stamcheva
|
||||
*/
|
||||
public interface CallInterfaceListener
|
||||
{
|
||||
/**
|
||||
* Indicates that the call interface was started.
|
||||
*/
|
||||
public void callInterfaceStarted();
|
||||
}
|
||||