Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.gui.main.contactlist
Class TreeContactList

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JTree
                  extended by net.java.sip.communicator.impl.gui.main.contactlist.DefaultTreeContactList
                      extended by net.java.sip.communicator.impl.gui.main.contactlist.TreeContactList
All Implemented Interfaces:
MouseListener, MouseMotionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, TreeExpansionListener, Scrollable, MetaContactQueryListener, ContactQueryListener, Skinnable

public class TreeContactList
extends DefaultTreeContactList
implements ContactQueryListener, MetaContactQueryListener, MouseListener, MouseMotionListener, TreeExpansionListener

The TreeContactList is a contact list based on JTree.

Author:
Yana Stamcheva
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JTree
JTree.AccessibleJTree, JTree.DropLocation, JTree.DynamicUtilTreeNode, JTree.EmptySelectionModel, JTree.TreeModelHandler, JTree.TreeSelectionRedirector
 
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
static CallHistoryFilter historyFilter
          The call history filter.
static MetaContactListSource mclSource
           
static PresenceFilter presenceFilter
          The presence filter.
static SearchFilter searchFilter
          The search filter.
 
Fields inherited from class javax.swing.JTree
ANCHOR_SELECTION_PATH_PROPERTY, CELL_EDITOR_PROPERTY, CELL_RENDERER_PROPERTY, cellEditor, cellRenderer, editable, EDITABLE_PROPERTY, EXPANDS_SELECTED_PATHS_PROPERTY, INVOKES_STOP_CELL_EDITING_PROPERTY, invokesStopCellEditing, LARGE_MODEL_PROPERTY, largeModel, LEAD_SELECTION_PATH_PROPERTY, ROOT_VISIBLE_PROPERTY, rootVisible, ROW_HEIGHT_PROPERTY, rowHeight, SCROLLS_ON_EXPAND_PROPERTY, scrollsOnExpand, SELECTION_MODEL_PROPERTY, selectionModel, selectionRedirector, SHOWS_ROOT_HANDLES_PROPERTY, showsRootHandles, TOGGLE_CLICK_COUNT_PROPERTY, toggleClickCount, TREE_MODEL_PROPERTY, treeModelListener, VISIBLE_ROW_COUNT_PROPERTY, visibleRowCount
 
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
TreeContactList()
          Creates the TreeContactList.
 
Method Summary
 void addContact(ContactQuery query, UIContact contact, UIGroup group, boolean isSorted)
          Adds the given contact to this list.
 void addContact(UIContact contact, UIGroup group, boolean isContactSorted, boolean isGroupSorted)
          Adds the given contact to this list.
 void addContactListListener(ContactListListener listener)
          Adds a listener for ContactListEvents.
 void addGroup(UIGroup group, boolean isSorted)
          Adds the given group to this list.
 FilterQuery applyDefaultFilter()
          Applies the default filter.
 FilterQuery applyFilter(ContactListFilter filter)
          Applies the given filter.
 void contactReceived(ContactReceivedEvent event)
          Indicates that a contact has been received for a query.
static JMenuItem createAddContactMenu(SourceContact sourceContact)
          Create an the add contact menu, taking into account the number of contact details available in the given sourceContact.
 void deactivateAll()
          Deactivates all active contacts.
protected  void fireContactListEvent(List<ContactListListener> contactListListeners, ContactListEvent event)
          Notifies all interested listeners that a ContactListEvent has occurred.
 void fireContactListEvent(Object source, int eventID, int clickCount)
          Creates the corresponding ContactListEvent and notifies all ContactListListeners that a contact is selected.
static ExternalContactSource getContactSource(ContactSourceService contactSource)
          Returns the ExternalContactSource corresponding to the given ContactSourceService.
static ExternalContactSource getContactSource(String identifier)
          Returns the contact source with the given identifier.
static Collection<ExternalContactSource> getContactSources()
          Returns the list of registered contact sources to search in.
 ContactListFilter getCurrentFilter()
          Returns the currently applied filter.
 MetaContactListSource getMetaContactListSource()
           
static NotificationContactSource getNotificationContactSource()
          Returns the notification contact source.
 Component getRightButtonMenu()
          Returns the right button menu opened over the contact list.
 ContactListTreeModel getTreeModel()
           
 boolean isContactActive(UIContact contact)
          Returns true if the given metaContact has been previously set to active, otherwise returns false.
 boolean isEmpty()
          Indicates if this contact list is empty.
 void metaContactQueryStatusChanged(MetaContactQueryStatusEvent event)
          Indicates that the status of a query has changed.
 void metaContactReceived(MetaContactQueryEvent event)
          Indicates that a MetaContact has been received for a search in the MetaContactListService.
 void metaGroupReceived(MetaGroupQueryEvent event)
          Indicates that a MetaGroup has been received from a search in the MetaContactListService.
 void mouseClicked(MouseEvent e)
          Manages a mouse click over the contact list.
 void mouseDragged(MouseEvent e)
           
 void mouseEntered(MouseEvent event)
          Forwards the given mouse event to the list of original MouseListener-s.
 void mouseExited(MouseEvent event)
          Forwards the given mouse event to the list of original MouseListener-s.
 void mouseMoved(MouseEvent e)
           
 void mousePressed(MouseEvent e)
          When the right mouse button is clicked on a contact cell, the cell is selected and the ContactRightButtonMenu is opened.
 void mouseReleased(MouseEvent event)
          Forwards the given mouse event to the list of original MouseListener-s.
 void nodeChanged(TreeNode node)
          Indicates that a node has been changed.
 void queryStatusChanged(ContactQueryStatusEvent event)
          Indicates that the status of a query has changed.
 void refreshContact(UIContact contact)
          Indicates that the information corresponding to the given contact has changed.
 void removeContact(UIContact contact)
          Removes the node corresponding to the given MetaContact from this list.
 void removeContactListListener(ContactListListener listener)
          Removes a listener previously added with addContactListListener.
 void removeGroup(UIGroup group)
          Removes the given group and its children from the list.
 void selectFirstContact()
          Selects the first found contact node from the beginning of the contact list.
 void setActiveContact(MetaContact metaContact, boolean isActive)
          Updates the active state of the contact node corresponding to the given MetaContact.
 void setDefaultFilter(ContactListFilter filter)
          Sets the default filter to the given filter.
 void setGroupClickConsumed(boolean isGroupClickConsumed)
          If set to true prevents all operations coming in response to a mouse click.
static void setSourceContactImage(String contactString, JLabel label, int imgWidth, int imgHeight)
          Searches for a source contact image for the given peer string in one of the available contact sources.
static void showAddContactDialog(ContactDetail contactDetail)
          Creates and shows an AddContactDialog with a predefined contactAddress and protocolProvider.
 void startSelectedContactCall()
          Starts a call with the currently selected contact in the contact list.
 void startSelectedContactChat()
          Starts a chat with the currently selected contact if any, otherwise nothing happens.
 void startSelectedContactDesktopSharing()
          Starts a desktop sharing session with the currently selected contact in the contact list.
 void startSelectedContactVideoCall()
          Starts a video call with the currently selected contact in the contact list.
 void treeCollapsed(TreeExpansionEvent event)
          Stores the state of the collapsed group.
 void treeExpanded(TreeExpansionEvent event)
          Stores the state of the expanded group.
 
Methods inherited from class net.java.sip.communicator.impl.gui.main.contactlist.DefaultTreeContactList
createToolTip, getSelectedValue, getToolTipText, isContactActive, loadSkin
 
Methods inherited from class javax.swing.JTree
addSelectionInterval, addSelectionPath, addSelectionPaths, addSelectionRow, addSelectionRows, addTreeExpansionListener, addTreeSelectionListener, addTreeWillExpandListener, cancelEditing, clearSelection, clearToggledPaths, collapsePath, collapseRow, convertValueToText, createTreeModel, createTreeModelListener, expandPath, expandRow, fireTreeCollapsed, fireTreeExpanded, fireTreeWillCollapse, fireTreeWillExpand, fireValueChanged, getAccessibleContext, getAnchorSelectionPath, getCellEditor, getCellRenderer, getClosestPathForLocation, getClosestRowForLocation, getDefaultTreeModel, getDescendantToggledPaths, getDragEnabled, getDropLocation, getDropMode, getEditingPath, getExpandedDescendants, getExpandsSelectedPaths, getInvokesStopCellEditing, getLastSelectedPathComponent, getLeadSelectionPath, getLeadSelectionRow, getMaxSelectionRow, getMinSelectionRow, getModel, getNextMatch, getPathBetweenRows, getPathBounds, getPathForLocation, getPathForRow, getPreferredScrollableViewportSize, getRowBounds, getRowCount, getRowForLocation, getRowForPath, getRowHeight, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getScrollsOnExpand, getSelectionCount, getSelectionModel, getSelectionPath, getSelectionPaths, getSelectionRows, getShowsRootHandles, getToggleClickCount, getTreeExpansionListeners, getTreeSelectionListeners, getTreeWillExpandListeners, getUI, getUIClassID, getVisibleRowCount, hasBeenExpanded, isCollapsed, isCollapsed, isEditable, isEditing, isExpanded, isExpanded, isFixedRowHeight, isLargeModel, isPathEditable, isPathSelected, isRootVisible, isRowSelected, isSelectionEmpty, isVisible, makeVisible, paramString, removeDescendantSelectedPaths, removeDescendantToggledPaths, removeSelectionInterval, removeSelectionPath, removeSelectionPaths, removeSelectionRow, removeSelectionRows, removeTreeExpansionListener, removeTreeSelectionListener, removeTreeWillExpandListener, scrollPathToVisible, scrollRowToVisible, setAnchorSelectionPath, setCellEditor, setCellRenderer, setDragEnabled, setDropMode, setEditable, setExpandedState, setExpandsSelectedPaths, setInvokesStopCellEditing, setLargeModel, setLeadSelectionPath, setModel, setRootVisible, setRowHeight, setScrollsOnExpand, setSelectionInterval, setSelectionModel, setSelectionPath, setSelectionPaths, setSelectionRow, setSelectionRows, setShowsRootHandles, setToggleClickCount, setUI, setVisibleRowCount, startEditingAtPath, stopEditing, treeDidChange, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, 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, 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
 

Field Detail

presenceFilter

public static final PresenceFilter presenceFilter
The presence filter.


mclSource

public static final MetaContactListSource mclSource

searchFilter

public static final SearchFilter searchFilter
The search filter.


historyFilter

public static final CallHistoryFilter historyFilter
The call history filter.

Constructor Detail

TreeContactList

public TreeContactList()
Creates the TreeContactList.

Method Detail

contactReceived

public void contactReceived(ContactReceivedEvent event)
Indicates that a contact has been received for a query.

Specified by:
contactReceived in interface ContactQueryListener
Parameters:
event - the ContactReceivedEvent that notified us

metaContactReceived

public void metaContactReceived(MetaContactQueryEvent event)
Indicates that a MetaContact has been received for a search in the MetaContactListService.

Specified by:
metaContactReceived in interface MetaContactQueryListener
Parameters:
event - the received MetaContactQueryEvent

metaGroupReceived

public void metaGroupReceived(MetaGroupQueryEvent event)
Indicates that a MetaGroup has been received from a search in the MetaContactListService.

Specified by:
metaGroupReceived in interface MetaContactQueryListener
Parameters:
event - the MetaContactGroupQueryEvent that has been received

queryStatusChanged

public void queryStatusChanged(ContactQueryStatusEvent event)
Indicates that the status of a query has changed.

Specified by:
queryStatusChanged in interface ContactQueryListener
Parameters:
event - the ContactQueryStatusEvent that notified us

metaContactQueryStatusChanged

public void metaContactQueryStatusChanged(MetaContactQueryStatusEvent event)
Indicates that the status of a query has changed.

Specified by:
metaContactQueryStatusChanged in interface MetaContactQueryListener
Parameters:
event - the ContactQueryStatusEvent that notified us

getRightButtonMenu

public Component getRightButtonMenu()
Returns the right button menu opened over the contact list.

Returns:
the right button menu opened over the contact list

deactivateAll

public void deactivateAll()
Deactivates all active contacts.


setActiveContact

public void setActiveContact(MetaContact metaContact,
                             boolean isActive)
Updates the active state of the contact node corresponding to the given MetaContact.

Parameters:
metaContact - the MetaContact to update
isActive - indicates if the node should be set to active

isContactActive

public boolean isContactActive(UIContact contact)
Returns true if the given metaContact has been previously set to active, otherwise returns false.

Overrides:
isContactActive in class DefaultTreeContactList
Parameters:
contact - the UIContact to check
Returns:
true if the given metaContact has been previously set to active, otherwise returns false

addContact

public void addContact(UIContact contact,
                       UIGroup group,
                       boolean isContactSorted,
                       boolean isGroupSorted)
Adds the given contact to this list.

Parameters:
contact - the UIContact to add
group - the UIGroup to add to
isContactSorted - indicates if the contact should be sorted regarding to the GroupNode policy
isGroupSorted - indicates if the group should be sorted regarding to the GroupNode policy in case it doesn't exist and should be added

addContact

public void addContact(ContactQuery query,
                       UIContact contact,
                       UIGroup group,
                       boolean isSorted)
Adds the given contact to this list.

Parameters:
query - the ContactQuery that adds the given contact
contact - the UIContact to add
group - the UIGroup to add to
isSorted - indicates if the contact should be sorted regarding to the GroupNode policy

removeContact

public void removeContact(UIContact contact)
Removes the node corresponding to the given MetaContact from this list.

Parameters:
contact - the UIContact to remove

refreshContact

public void refreshContact(UIContact contact)
Indicates that the information corresponding to the given contact has changed.

Parameters:
contact - the contact that has changed

addGroup

public void addGroup(UIGroup group,
                     boolean isSorted)
Adds the given group to this list.

Parameters:
group - the UIGroup to add
isSorted - indicates if the contact should be sorted regarding to the GroupNode policy

removeGroup

public void removeGroup(UIGroup group)
Removes the given group and its children from the list.

Parameters:
group - the UIGroup to remove

addContactListListener

public void addContactListListener(ContactListListener listener)
Adds a listener for ContactListEvents.

Parameters:
listener - the listener to add

removeContactListListener

public void removeContactListListener(ContactListListener listener)
Removes a listener previously added with addContactListListener.

Parameters:
listener - the listener to remove

setGroupClickConsumed

public void setGroupClickConsumed(boolean isGroupClickConsumed)
If set to true prevents all operations coming in response to a mouse click.

Parameters:
isGroupClickConsumed - indicates if the group click event is consumed by an external party

applyDefaultFilter

public FilterQuery applyDefaultFilter()
Applies the default filter.

Returns:
the filter query that keeps track of the filtering results

applyFilter

public FilterQuery applyFilter(ContactListFilter filter)
Applies the given filter.

Parameters:
filter - the ContactListFilter to apply.
Returns:
the filter query

setDefaultFilter

public void setDefaultFilter(ContactListFilter filter)
Sets the default filter to the given filter.

Parameters:
filter - the ContactListFilter to set as default

getCurrentFilter

public ContactListFilter getCurrentFilter()
Returns the currently applied filter.

Returns:
the currently applied filter

isEmpty

public boolean isEmpty()
Indicates if this contact list is empty.

Returns:
true if this contact list contains no children, otherwise returns false

selectFirstContact

public void selectFirstContact()
Selects the first found contact node from the beginning of the contact list.


fireContactListEvent

public void fireContactListEvent(Object source,
                                 int eventID,
                                 int clickCount)
Creates the corresponding ContactListEvent and notifies all ContactListListeners that a contact is selected.

Parameters:
source - the contact that this event is about.
eventID - the id indicating the exact type of the event to fire.
clickCount - the number of clicks accompanying the event.

fireContactListEvent

protected void fireContactListEvent(List<ContactListListener> contactListListeners,
                                    ContactListEvent event)
Notifies all interested listeners that a ContactListEvent has occurred.

Parameters:
contactListListeners - the list of listeners to notify
event - the ContactListEvent to trigger

mouseClicked

public void mouseClicked(MouseEvent e)
Manages a mouse click over the contact list. When the left mouse button is clicked on a contact cell different things may happen depending on the contained component under the mouse. If the mouse is double clicked on the "contact name" the chat window is opened, configured to use the default protocol contact for the selected MetaContact. If the mouse is clicked on one of the protocol icons, the chat window is opened, configured to use the protocol contact corresponding to the given icon. When the right mouse button is clicked on a contact cell, the cell is selected and the ContactRightButtonMenu is opened. When the right mouse button is clicked on a group cell, the cell is selected and the GroupRightButtonMenu is opened. When the middle mouse button is clicked on a cell, the cell is selected.

Specified by:
mouseClicked in interface MouseListener
Parameters:
e - the MouseEvent that notified us of the click

mousePressed

public void mousePressed(MouseEvent e)
When the right mouse button is clicked on a contact cell, the cell is selected and the ContactRightButtonMenu is opened. When the right mouse button is clicked on a group cell, the cell is selected and the GroupRightButtonMenu is opened. When the middle mouse button is clicked on a cell, the cell is selected.

Specified by:
mousePressed in interface MouseListener
Parameters:
e - the MouseEvent that notified us of the press

mouseEntered

public void mouseEntered(MouseEvent event)
Forwards the given mouse event to the list of original MouseListener-s.

Specified by:
mouseEntered in interface MouseListener
Parameters:
event - the MouseEvent that notified us

mouseExited

public void mouseExited(MouseEvent event)
Forwards the given mouse event to the list of original MouseListener-s.

Specified by:
mouseExited in interface MouseListener
Parameters:
event - the MouseEvent that notified us

mouseReleased

public void mouseReleased(MouseEvent event)
Forwards the given mouse event to the list of original MouseListener-s.

Specified by:
mouseReleased in interface MouseListener
Parameters:
event - the MouseEvent that notified us

mouseMoved

public void mouseMoved(MouseEvent e)
Specified by:
mouseMoved in interface MouseMotionListener

mouseDragged

public void mouseDragged(MouseEvent e)
Specified by:
mouseDragged in interface MouseMotionListener

treeCollapsed

public void treeCollapsed(TreeExpansionEvent event)
Stores the state of the collapsed group.

Specified by:
treeCollapsed in interface TreeExpansionListener
Parameters:
event - the TreeExpansionEvent that notified us for about the expansion

treeExpanded

public void treeExpanded(TreeExpansionEvent event)
Stores the state of the expanded group.

Specified by:
treeExpanded in interface TreeExpansionListener
Parameters:
event - the TreeExpansionEvent that notified us for about the expansion

startSelectedContactChat

public void startSelectedContactChat()
Starts a chat with the currently selected contact if any, otherwise nothing happens. A chat is started with only MetaContacts for now.


startSelectedContactCall

public void startSelectedContactCall()
Starts a call with the currently selected contact in the contact list.


startSelectedContactVideoCall

public void startSelectedContactVideoCall()
Starts a video call with the currently selected contact in the contact list.


startSelectedContactDesktopSharing

public void startSelectedContactDesktopSharing()
Starts a desktop sharing session with the currently selected contact in the contact list.


nodeChanged

public void nodeChanged(TreeNode node)
Indicates that a node has been changed. Transfers the event to the default tree model.

Parameters:
node - the TreeNode that has been refreshed

getContactSources

public static Collection<ExternalContactSource> getContactSources()
Returns the list of registered contact sources to search in.

Returns:
the list of registered contact sources to search in

getNotificationContactSource

public static NotificationContactSource getNotificationContactSource()
Returns the notification contact source.

Returns:
the notification contact source

getContactSource

public static ExternalContactSource getContactSource(ContactSourceService contactSource)
Returns the ExternalContactSource corresponding to the given ContactSourceService.

Parameters:
contactSource - the ContactSourceService, which corresponding external source implementation we're looking for
Returns:
the ExternalContactSource corresponding to the given ContactSourceService

getContactSource

public static ExternalContactSource getContactSource(String identifier)
Returns the contact source with the given identifier.

Parameters:
identifier - the identifier we're looking for
Returns:
the contact source with the given identifier

setSourceContactImage

public static void setSourceContactImage(String contactString,
                                         JLabel label,
                                         int imgWidth,
                                         int imgHeight)
Searches for a source contact image for the given peer string in one of the available contact sources.

Parameters:
contactString - the address of the contact to search an image for
label - the label to set the image to
imgWidth - the desired image width
imgHeight - the desired image height

createAddContactMenu

public static JMenuItem createAddContactMenu(SourceContact sourceContact)
Create an the add contact menu, taking into account the number of contact details available in the given sourceContact.

Parameters:
sourceContact - the external source contact, for which we'd like to create a menu
Returns:
the add contact menu

showAddContactDialog

public static void showAddContactDialog(ContactDetail contactDetail)
Creates and shows an AddContactDialog with a predefined contactAddress and protocolProvider.

Parameters:
contactDetail - the contact detail to be added

getTreeModel

public ContactListTreeModel getTreeModel()

getMetaContactListSource

public MetaContactListSource getMetaContactListSource()

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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