com.joctopus.ui.joctopus
Class ChatBoard

java.lang.Object
  extended by com.joctopus.ui.joctopus.ChatBoard
All Implemented Interfaces:
IChat, java.awt.event.ActionListener, java.util.EventListener

public class ChatBoard
extends java.lang.Object
implements IChat, java.awt.event.ActionListener

encapsulates chat tabs for each user.

Since:
1.0

Field Summary
protected  javax.swing.JButton btnTabButton
           
protected  ChatAreaTracker caTracker
           
protected  javax.swing.JFrame chatFrame
           
protected  javax.swing.JTabbedPane chatTabbs
           
protected  javax.swing.ImageIcon chatterIcon
           
protected  java.awt.Font fnt
           
protected  ChatterHandler handler
           
protected  javax.swing.JMenuItem mnuClear
           
protected  javax.swing.JMenuItem mnuClearHistory
           
protected  javax.swing.JMenuItem mnuLoadRefresh
           
protected  javax.swing.JMenuItem mnuSave
           
protected  javax.swing.JMenuItem mnuTClose
           
protected  javax.swing.JMenuItem mnuView
           
protected  javax.swing.JPopupMenu popChatBoard
           
protected  javax.swing.JPopupMenu popTab
           
protected  JOctopusConsole viewHistory
           
protected  java.util.Vector<Users> vUsers
          stores different users, from which we can know that which users are currently present in chat board
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void closeCurrentTab()
          closes current selected tab, also removes user from users list
 void createORShowChatTabForUser(Users user, boolean show, boolean takeHistory)
          user, to be searched if found then select that particular tab else, create a new chat tab with existing chat panel.
 java.awt.Component createTabComponent(java.lang.String title)
          creates new Tab component for a Tab.
 javax.swing.JFrame getChatFrame()
           
 javax.swing.JTabbedPane getChatTabbs()
           
 javax.swing.JPopupMenu getPopChatBoard(ChatPanel panel)
           
 javax.swing.JPopupMenu getPopTab()
           
 java.util.Vector<Users> getvUsers()
           
 void selectTab(Users user)
           
 void sendMessage()
          called when send message operation is triggered by ChatAreaTracker.
 void setPopChatBoard(javax.swing.JPopupMenu popChatBoard)
           
 void setPopTab(javax.swing.JPopupMenu popTab)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vUsers

protected java.util.Vector<Users> vUsers
stores different users, from which we can know that which users are currently present in chat board


fnt

protected java.awt.Font fnt

chatTabbs

protected javax.swing.JTabbedPane chatTabbs

chatFrame

protected javax.swing.JFrame chatFrame

caTracker

protected ChatAreaTracker caTracker

handler

protected ChatterHandler handler

popChatBoard

protected javax.swing.JPopupMenu popChatBoard

popTab

protected javax.swing.JPopupMenu popTab

viewHistory

protected JOctopusConsole viewHistory

mnuLoadRefresh

protected javax.swing.JMenuItem mnuLoadRefresh

mnuSave

protected javax.swing.JMenuItem mnuSave

mnuView

protected javax.swing.JMenuItem mnuView

mnuClear

protected javax.swing.JMenuItem mnuClear

mnuClearHistory

protected javax.swing.JMenuItem mnuClearHistory

mnuTClose

protected javax.swing.JMenuItem mnuTClose

chatterIcon

protected final javax.swing.ImageIcon chatterIcon

btnTabButton

protected javax.swing.JButton btnTabButton
Method Detail

getvUsers

public java.util.Vector<Users> getvUsers()
Returns:
the vUsers

getChatTabbs

public javax.swing.JTabbedPane getChatTabbs()
Returns:
Tabs in chat board.

getChatFrame

public javax.swing.JFrame getChatFrame()
Returns:
chat board frame.

createORShowChatTabForUser

public void createORShowChatTabForUser(Users user,
                                       boolean show,
                                       boolean takeHistory)
user, to be searched if found then select that particular tab else, create a new chat tab with existing chat panel. The main feature is that wheather you chat in main chatter window or in chat board, chat history will be reflected dynamically This method is only used for poping out from main chatter frame.

Parameters:
user - user to be added
show -
takeHistory -

selectTab

public void selectTab(Users user)
Parameters:
user - selects the tab based on particular user.

closeCurrentTab

public void closeCurrentTab()
closes current selected tab, also removes user from users list


createTabComponent

public java.awt.Component createTabComponent(java.lang.String title)
creates new Tab component for a Tab.

Parameters:
title - title of tab.
Returns:
Tab Component.

sendMessage

public void sendMessage()
Description copied from interface: IChat
called when send message operation is triggered by ChatAreaTracker.

Specified by:
sendMessage in interface IChat

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

getPopChatBoard

public javax.swing.JPopupMenu getPopChatBoard(ChatPanel panel)
Parameters:
panel - panel to which the popup menu to be assigned
Returns:

setPopChatBoard

public void setPopChatBoard(javax.swing.JPopupMenu popChatBoard)
Parameters:
popChatBoard - Popup menu for ChatBoard.

getPopTab

public javax.swing.JPopupMenu getPopTab()
Returns:
popup menu for tab.

setPopTab

public void setPopTab(javax.swing.JPopupMenu popTab)
Parameters:
popTab -