Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.gui.main
Class SingleWindowContainer

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.SingleWindowContainer
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener, CallContainer, CallTitleListener, ChatContainer

public class SingleWindowContainer
extends TransparentPanel
implements ChatContainer, CallContainer, CallTitleListener, ChangeListener

The container of the single window interface.

Author:
Yana Stamcheva
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
SingleWindowContainer()
          Creates an instance of the SingleWindowContainer.
 
Method Summary
 void addCallPanel(CallPanel callPanel)
          Adds the given CallPanel to this call window.
 void addChat(ChatPanel chatPanel)
          Adds a given ChatPanel to this chat window.
 void addChatChangeListener(ChatChangeListener listener)
          Adds the given ChatChangeListener.
 void callTitleChanged(CallPanel callPanel)
          Called when the title of the given CallPanel changes.
 void close(CallPanel callPanel)
          Closes the given CallPanel.
 void closeWait(CallPanel callPanel)
          Closes the given CallPanel.
 boolean containsFocus()
          Indicates if one of the contained components is currently the owner of the keyboard focus.
 int getChatCount()
          Returns the number of all open chats.
 List<ChatPanel> getChats()
          Returns the currently available chat panels.
 ChatPanel getCurrentChat()
          Returns the currently selected chat panel.
 JFrame getFrame()
          Returns the frame to which this container belongs.
 void openChat(ChatPanel chatPanel, boolean setSelected)
          Opens the specified ChatPanel and optinally brings it to the front.
 void pack()
          Packs the content of this call window.
 void removeAllChats()
          Removes all tabs in the chat tabbed pane.
 void removeChat(ChatPanel chatPanel)
          Removes a given ChatPanel from this chat window.
 void removeChatChangeListener(ChatChangeListener listener)
          Removes the given ChatChangeListener.
 void setChatIcon(ChatPanel chatPanel, Icon icon)
          Sets the icon for the given chat.
 void setChatTitle(ChatPanel chatPanel, String title)
          Sets the title of this chat container.
 void setCurrentChat(ChatPanel chatPanel)
          Selects the chat tab which corresponds to the given MetaContact.
 void setTabIcon(ChatPanel chatPanel, Icon icon)
          Sets the given icon to the tab opened for the given chat panel.
 void setTabTitle(ChatPanel chatPanel, String title)
          Sets the given title to the tab opened for the given chat panel.
 void setTitle(String title)
          Sets the title of this chat container.
 void setToolbarVisible(boolean isVisible)
          Shows/hides the toolbar.
 void stateChanged(ChangeEvent event)
          Shows/hides the toolbar depending on the selected tab.
 void updateHistoryButtonState(ChatPanel chatPanel)
          Updates history buttons state.
 
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

SingleWindowContainer

public SingleWindowContainer()
Creates an instance of the SingleWindowContainer.

Method Detail

setTitle

public void setTitle(String title)
Description copied from interface: ChatContainer
Sets the title of this chat container.

Specified by:
setTitle in interface ChatContainer
Parameters:
title - the title to set

addChat

public void addChat(ChatPanel chatPanel)
Adds a given ChatPanel to this chat window.

Specified by:
addChat in interface ChatContainer
Parameters:
chatPanel - The ChatPanel to add.

removeChat

public void removeChat(ChatPanel chatPanel)
Removes a given ChatPanel from this chat window.

Specified by:
removeChat in interface ChatContainer
Parameters:
chatPanel - The ChatPanel to remove.

getCurrentChat

public ChatPanel getCurrentChat()
Returns the currently selected chat panel.

Specified by:
getCurrentChat in interface ChatContainer
Returns:
the currently selected chat panel.

setCurrentChat

public void setCurrentChat(ChatPanel chatPanel)
Selects the chat tab which corresponds to the given MetaContact.

Specified by:
setCurrentChat in interface ChatContainer
Parameters:
chatPanel - The ChatPanel to select.

setToolbarVisible

public void setToolbarVisible(boolean isVisible)
Shows/hides the toolbar.

Specified by:
setToolbarVisible in interface ChatContainer
Parameters:
isVisible -

removeAllChats

public void removeAllChats()
Removes all tabs in the chat tabbed pane. If not in mode TABBED_CHAT_WINDOW does nothing.

Specified by:
removeAllChats in interface ChatContainer

getChatCount

public int getChatCount()
Returns the number of all open chats.

Specified by:
getChatCount in interface ChatContainer
Returns:
the number of all open chats

getChats

public List<ChatPanel> getChats()
Returns the currently available chat panels.

Specified by:
getChats in interface ChatContainer
Returns:
the currently available chat panels.

openChat

public void openChat(ChatPanel chatPanel,
                     boolean setSelected)
Opens the specified ChatPanel and optinally brings it to the front.

Specified by:
openChat in interface ChatContainer
Parameters:
chatPanel - the ChatPanel to be opened
setSelected - true if chatPanel (and respectively this ChatContainer) should be brought to the front; otherwise, false

setChatTitle

public void setChatTitle(ChatPanel chatPanel,
                         String title)
Description copied from interface: ChatContainer
Sets the title of this chat container.

Specified by:
setChatTitle in interface ChatContainer
Parameters:
chatPanel - the chat, for which we set the title
title - the title to set

setChatIcon

public void setChatIcon(ChatPanel chatPanel,
                        Icon icon)
Description copied from interface: ChatContainer
Sets the icon for the given chat.

Specified by:
setChatIcon in interface ChatContainer
Parameters:
chatPanel - the chat, for which we want to set an icon
icon - the icon to set

updateHistoryButtonState

public void updateHistoryButtonState(ChatPanel chatPanel)
Updates history buttons state.

Specified by:
updateHistoryButtonState in interface ChatContainer
Parameters:
chatPanel - the chat panel for which we should update button states

getFrame

public JFrame getFrame()
Returns the frame to which this container belongs.

Specified by:
getFrame in interface CallContainer
Specified by:
getFrame in interface ChatContainer
Returns:
the frame to which this container belongs

addChatChangeListener

public void addChatChangeListener(ChatChangeListener listener)
Adds the given ChatChangeListener.

Specified by:
addChatChangeListener in interface ChatContainer
Parameters:
listener - the listener to add

removeChatChangeListener

public void removeChatChangeListener(ChatChangeListener listener)
Removes the given ChatChangeListener.

Specified by:
removeChatChangeListener in interface ChatContainer
Parameters:
listener - the listener to remove

containsFocus

public boolean containsFocus()
Indicates if one of the contained components is currently the owner of the keyboard focus.

Returns:
true to indicate that a component contained in this container currently owns the keyboard focus, false - otherwise

close

public void close(CallPanel callPanel)
Closes the given CallPanel.

Specified by:
close in interface CallContainer
Parameters:
callPanel - the CallPanel to close

closeWait

public void closeWait(CallPanel callPanel)
Closes the given CallPanel.

Specified by:
closeWait in interface CallContainer
Parameters:
callPanel - the CallPanel to close

pack

public void pack()
Packs the content of this call window.

Specified by:
pack in interface CallContainer

addCallPanel

public void addCallPanel(CallPanel callPanel)
Adds the given CallPanel to this call window.

Specified by:
addCallPanel in interface CallContainer
Parameters:
callPanel - the CallPanel to add

callTitleChanged

public void callTitleChanged(CallPanel callPanel)
Called when the title of the given CallPanel changes.

Specified by:
callTitleChanged in interface CallTitleListener
Parameters:
callPanel - the CallPanel, which title has changed

stateChanged

public void stateChanged(ChangeEvent event)
Shows/hides the toolbar depending on the selected tab.

Specified by:
stateChanged in interface ChangeListener
Parameters:
event - the ChangeEvent that notified us of the tab selection change

setTabIcon

public void setTabIcon(ChatPanel chatPanel,
                       Icon icon)
Sets the given icon to the tab opened for the given chat panel.

Parameters:
chatPanel - the chat panel, which corresponds the tab
icon - the icon to be set

setTabTitle

public void setTabTitle(ChatPanel chatPanel,
                        String title)
Sets the given title to the tab opened for the given chat panel.

Parameters:
chatPanel - the chat panel
title - the new title of the tab

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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