SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.gui.main.call
Class MainCallPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by net.java.sip.communicator.util.swing.TransparentPanel
                      extended by net.java.sip.communicator.impl.gui.main.call.MainCallPanel
All Implemented Interfaces:
ActionListener, MouseListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ListSelectionListener, PluginComponentListener, RegistrationStateChangeListener

public class MainCallPanel
extends TransparentPanel
implements ActionListener, ListSelectionListener, RegistrationStateChangeListener, PluginComponentListener, MouseListener

The panel containing the call field and button, serving to make calls.

Author:
Yana Stamcheva, Lubomir Marinov
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
MainCallPanel(MainFrame mainFrame)
          Initializes and constructs this panel.
 
Method Summary
 void actionPerformed(ActionEvent evt)
          Handles the ActionEvent generated when user presses one of the buttons in this panel.
 void addCallAccount(ProtocolProviderService pps)
          Adds the given call account to the list of call via accounts.
 boolean containsCallAccount(ProtocolProviderService pps)
          Returns TRUE if the account corresponding to the given protocol provider is already contained in the call via selector box, otherwise returns FALSE.
 AccountSelectorBox getAccountSelectorBox()
          Returns the account selector box.
 ProtocolProviderService getCallProvider()
          Gets the protocol provider used for making calls.
 MainFrame getMainFrame()
          Returns the main application window, which is the parent of this panel.
 String getPhoneNumberComboText()
          Returns the content of the phone number combo box.
 void mouseClicked(MouseEvent e)
           
 void mouseEntered(MouseEvent e)
           
 void mouseExited(MouseEvent e)
           
 void mousePressed(MouseEvent e)
           
 void mouseReleased(MouseEvent e)
           
 void pluginComponentAdded(PluginComponentEvent event)
          Indicates that a plugin component has been successfully added to the container.
 void pluginComponentRemoved(PluginComponentEvent event)
          Indicates that a plugin component has been successfully removed from the container.
 void registrationStateChanged(RegistrationStateChangeEvent evt)
          The method is called by a ProtocolProviderService implementation whenever a change in the registration state of the corresponding provider had occurred.
 void removeCallAccount(ProtocolProviderService pps)
          Removes the account corresponding to the given protocol provider from the call via selector box.
 void requestFocusInPhoneCombo()
          Requests the focus in the phone number combo box.
 void setCallButtonEnabled(boolean isEnabled)
          Enables or disabled the call button.
 void setCallMetaContact(boolean isCallMetaContact)
          Sets the isCallMetaContact variable to TRUE or FALSE.
 void setCallProvider(ProtocolProviderService protocolProvider)
          Sets the protocol provider to be used for making calls.
 void setPhoneNumberComboText(String phoneNumber)
          Sets the given phoneNumber to the phone number combo box.
 void updateCallAccountStatus(ProtocolProviderService pps)
          Updates the call via account status.
 void valueChanged(ListSelectionEvent e)
          Implements ListSelectionListener.valueChanged.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MainCallPanel

public MainCallPanel(MainFrame mainFrame)
Initializes and constructs this panel.

Parameters:
mainFrame - the main application window
Method Detail

actionPerformed

public void actionPerformed(ActionEvent evt)
Handles the ActionEvent generated when user presses one of the buttons in this panel.

Specified by:
actionPerformed in interface ActionListener

getMainFrame

public MainFrame getMainFrame()
Returns the main application window, which is the parent of this panel.

Returns:
the main application window, which is the parent of this panel.

getCallProvider

public ProtocolProviderService getCallProvider()
Gets the protocol provider used for making calls.

Returns:
the protocol provider service

setCallProvider

public void setCallProvider(ProtocolProviderService protocolProvider)
Sets the protocol provider to be used for making calls.

Parameters:
protocolProvider - the protocol provider to be used for making calls.

setCallMetaContact

public void setCallMetaContact(boolean isCallMetaContact)
Sets the isCallMetaContact variable to TRUE or FALSE. This defines if this call is a call to a given meta contact selected from the contact list or a call to an external contact or phone number.

Parameters:
isCallMetaContact - TRUE to define this call as a call to an internal meta contact and FALSE to define it as a call to an external contact or phone number.

setCallButtonEnabled

public void setCallButtonEnabled(boolean isEnabled)
Enables or disabled the call button.

Parameters:
isEnabled - true to enable the call button and false otherwise.

setPhoneNumberComboText

public void setPhoneNumberComboText(String phoneNumber)
Sets the given phoneNumber to the phone number combo box.

Parameters:
phoneNumber - the phone number to set.

getPhoneNumberComboText

public String getPhoneNumberComboText()
Returns the content of the phone number combo box.

Returns:
the content of the phone number combo box.

requestFocusInPhoneCombo

public void requestFocusInPhoneCombo()
Requests the focus in the phone number combo box.


addCallAccount

public void addCallAccount(ProtocolProviderService pps)
Adds the given call account to the list of call via accounts.

Parameters:
pps - the protocol provider service corresponding to the account

removeCallAccount

public void removeCallAccount(ProtocolProviderService pps)
Removes the account corresponding to the given protocol provider from the call via selector box.

Parameters:
pps - the protocol provider service to remove

containsCallAccount

public boolean containsCallAccount(ProtocolProviderService pps)
Returns TRUE if the account corresponding to the given protocol provider is already contained in the call via selector box, otherwise returns FALSE.

Parameters:
pps - the protocol provider service for the account
Returns:
TRUE if the account corresponding to the given protocol provider is already contained in the call via selector box, otherwise returns FALSE

updateCallAccountStatus

public void updateCallAccountStatus(ProtocolProviderService pps)
Updates the call via account status.

Parameters:
pps - the protocol provider service for the account

getAccountSelectorBox

public AccountSelectorBox getAccountSelectorBox()
Returns the account selector box.

Returns:
the account selector box.

valueChanged

public void valueChanged(ListSelectionEvent e)
Implements ListSelectionListener.valueChanged. Enables or disables call and hangup buttons depending on the selection in the contactlist.

Specified by:
valueChanged in interface ListSelectionListener

registrationStateChanged

public void registrationStateChanged(RegistrationStateChangeEvent evt)
Description copied from interface: RegistrationStateChangeListener
The method is called by a ProtocolProviderService implementation whenever a change in the registration state of the corresponding provider had occurred.

Specified by:
registrationStateChanged in interface RegistrationStateChangeListener
Parameters:
evt - the event describing the status change.

pluginComponentAdded

public void pluginComponentAdded(PluginComponentEvent event)
Description copied from interface: PluginComponentListener
Indicates that a plugin component has been successfully added to the container.

Specified by:
pluginComponentAdded in interface PluginComponentListener
Parameters:
event - the PluginComponentEvent containing the corresponding plugin component

pluginComponentRemoved

public void pluginComponentRemoved(PluginComponentEvent event)
Description copied from interface: PluginComponentListener
Indicates that a plugin component has been successfully removed from the container.

Specified by:
pluginComponentRemoved in interface PluginComponentListener
Parameters:
event - the PluginComponentEvent containing the corresponding plugin component

mouseClicked

public void mouseClicked(MouseEvent e)
Specified by:
mouseClicked in interface MouseListener

mousePressed

public void mousePressed(MouseEvent e)
Specified by:
mousePressed in interface MouseListener

mouseReleased

public void mouseReleased(MouseEvent e)
Specified by:
mouseReleased in interface MouseListener

mouseEntered

public void mouseEntered(MouseEvent e)
Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent e)
Specified by:
mouseExited in interface MouseListener

SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.