|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
net.java.sip.communicator.util.swing.TransparentPanel
net.java.sip.communicator.impl.gui.main.chat.ChatPanel
public class ChatPanel
The ChatPanel is the panel, where users can write and send messages, view received messages. A ChatPanel is created for a contact or for a group of contacts in case of a chat conference. There is always one default contact for the chat, which is the first contact which was added to the chat. When chat is in mode "open all messages in new window", each ChatPanel corresponds to a ChatWindow. When chat is in mode "group all messages in one chat window", each ChatPanel corresponds to a tab in the ChatWindow.
| 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 | |
|---|---|
ChatSession |
chatSession
|
protected static int |
MESSAGES_PER_PAGE
The number of messages shown per page. |
static int |
TYPING_NOTIFICATION_SEND_FAILED
Indicates that sending a typing notification event has failed. |
static int |
TYPING_NOTIFICATION_SUCCESSFULLY_SENT
Indicates that a typing notification event is successfully sent. |
int |
unreadMessageNumber
|
| 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 net.java.sip.communicator.service.gui.Chat |
|---|
ACTION_MESSAGE, CHAT_BUFFER_SIZE, ERROR_MESSAGE, HISTORY_INCOMING_MESSAGE, HISTORY_OUTGOING_MESSAGE, INCOMING_MESSAGE, OUTGOING_MESSAGE, SMS_MESSAGE, STATUS_MESSAGE, SYSTEM_MESSAGE |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
ChatPanel(ChatContainer chatContainer)
Creates a ChatPanel which is added to the given chat window. |
|
| Method Summary | |
|---|---|
void |
addActiveFileTransfer(String id,
Object descriptor)
Adds the given file transfer id to the list of active file transfers. |
void |
addChatContact(ChatContact<?> chatContact)
Adds the given chatContact to the list of chat contacts participating in the corresponding to this chat panel chat. |
void |
addChatEditorCaretListener(CaretListener l)
Adds the given CaretListener to this Chat. |
void |
addChatEditorDocumentListener(DocumentListener l)
Adds the given DocumentListener to this Chat. |
void |
addChatEditorKeyListener(KeyListener l)
Adds the given KeyListener to this Chat. |
void |
addChatEditorMenuListener(ChatMenuListener l)
Adds the given ChatMenuListener to this Chat. |
void |
addChatFocusListener(ChatFocusListener listener)
Implements Chat.addChatFocusListener method. |
void |
addChatHistoryListener(ChatHistoryListener l)
Adds the given ChatHistoryListener to the list of listeners notified when a change occurs in the history shown in this chat panel. |
void |
addChatLinkClickedListener(ChatLinkClickedListener listener)
Add a new ChatLinkClickedListener |
void |
addChatTransport(ChatTransport chatTransport)
Adds the given chatTransport to the given send via selector box. |
void |
addErrorMessage(String contactName,
String message)
Adds the given error message to the chat window conversation area. |
void |
addErrorMessage(String contactName,
String title,
String message)
Adds the given error message to the chat window conversation area. |
void |
addIncomingFileTransferRequest(OperationSetFileTransfer fileTransferOpSet,
IncomingFileTransferRequest request,
Date date)
Adds the given IncomingFileTransferRequest to the conversation panel in order to notify the user of the incoming file. |
void |
addMessage(String contactName,
long date,
String messageType,
String message,
String contentType)
Passes the message to the contained ChatConversationPanel
for processing and appends it at the end of the conversationPanel
document. |
void |
addMessage(String contactName,
long date,
String messageType,
String title,
String message,
String contentType)
Passes the message to the contained ChatConversationPanel
for processing and appends it at the end of the conversationPanel
document. |
void |
addMessage(String contactName,
String displayName,
long date,
String messageType,
String message,
String contentType)
Passes the message to the contained ChatConversationPanel
for processing and appends it at the end of the conversationPanel
document. |
void |
addTextInWriteArea(String text)
Adds text to the write area editor. |
void |
addTypingNotification(String typingNotification)
Adds a typing notification message to the conversation panel. |
void |
cancelActiveFileTransfers()
Cancels all active file transfers. |
void |
chatRoomPropertyChanged(ChatRoomMemberPropertyChangeEvent event)
Notifies the user if any member of the chatroom changes nickname. |
boolean |
containsActiveFileTransfers()
Returns true if there are active file transfers, otherwise
returns false. |
void |
copy()
Copies either the selected write area content or the selected conversation panel content to the clipboard. |
void |
copyWriteArea()
Copies the selected write panel content to the clipboard. |
void |
cut()
Cuts the write area selected content to the clipboard. |
void |
dispose()
Runs clean-up for associated resources which need explicit disposal (e.g. |
ChatTransport |
findFileTransferChatTransport()
Returns the first chat transport for the current chat session that supports file transfer. |
ChatTransport |
findInviteChatTransport()
Returns the first chat transport for the current chat session that supports group chat. |
void |
fireChatFocusEvent(int eventID)
Informs all ChatFocusListeners that a ChatFocusEvent has been triggered. |
int |
getCaretPosition()
Gets the caret position in the chat editor. |
ChatContainer |
getChatContainer()
Returns the chat window, where this chat panel is added. |
ChatConversationPanel |
getChatConversationPanel()
Returns the conversation panel, contained in this chat panel. |
ChatSession |
getChatSession()
Returns the chat session associated with this chat panel. |
ChatWritePanel |
getChatWritePanel()
Returns the write area panel, contained in this chat panel. |
Window |
getConversationContainerWindow()
Returns the chat window, where this chat panel is located. |
int |
getDividerLocation()
Returns the contained divider location. |
int |
getDividerSize()
Returns the contained divider size. |
long |
getFirstHistoryMsgTimestamp()
Returns the date of the first message in history for this chat. |
Highlighter |
getHighlighter()
Provides the Highlighter used in rendering the chat editor. |
long |
getLastHistoryMsgTimestamp()
Returns the date of the last message in history for this chat. |
String |
getMessage()
Returns the message written by user in the chat write area. |
String |
getRoleDescription(ChatRoomMemberRole role)
Returns the corresponding role description to the given role index. |
String |
getTextFromWriteArea(String mimeType)
Returns the text contained in the write area editor. |
void |
inviteContacts(ChatTransport inviteChatTransport,
Collection<String> chatContacts,
String reason)
Invites the given chatContacts to this chat. |
boolean |
isChatFocused()
Implements the Chat.isChatFocused method. |
boolean |
isShown()
Returns TRUE if this chat panel is added to a container (window or tabbed pane), which is shown on the screen, FALSE - otherwise. |
boolean |
isWriteAreaEmpty()
Checks if the editor contains text. |
void |
loadHistory()
Loads history for the chat meta contact in a separate thread. |
void |
loadHistory(String escapedMessageID)
Loads history messages ignoring the message with the specified id. |
void |
loadNextPageFromHistory()
Implements ChatPanel.loadNextFromHistory. |
void |
loadPreviousPageFromHistory()
Implements ChatPanel.loadPreviousFromHistory. |
void |
loadSkin()
Reloads chat messages. |
void |
localUserRoleChanged(ChatRoomLocalUserRoleChangeEvent evt)
Implements the localUserRoleChanged() method. |
void |
memberRoleChanged(ChatRoomMemberRoleChangeEvent evt)
Implements the memberRoleChanged() method. |
void |
paste()
Pastes the content of the clipboard to the write area. |
void |
promptRepaint()
Causes the chat to validate its appearance (suggests a repaint operation may be necessary). |
void |
refreshWriteArea()
Refreshes write area editor pane. |
void |
removeActiveFileTransfer(String id)
Removes the given file transfer id from the list of active file transfers. |
void |
removeAllChatContacts()
Removes all chat contacts from the contact list of the chat. |
void |
removeChatContact(ChatContact<?> chatContact)
Removes the given chatContact from the list of chat contacts participating in the corresponding to this chat panel chat. |
void |
removeChatEditorCaretListener(CaretListener l)
Removes the given CaretListener from this Chat. |
void |
removeChatEditorDocumentListener(DocumentListener l)
Removes the given DocumentListener from this Chat. |
void |
removeChatEditorKeyListener(KeyListener l)
Removes the given KeyListener from this Chat. |
void |
removeChatEditorMenuListener(ChatMenuListener l)
Removes the given ChatMenuListener to this Chat. |
void |
removeChatFocusListener(ChatFocusListener listener)
Implements Chat.removeChatFocusListener method. |
void |
removeChatHistoryListener(ChatHistoryListener l)
Removes the given ChatHistoryListener from the list of listeners notified when a change occurs in the history shown in this chat panel. |
void |
removeChatLinkClickedListener(ChatLinkClickedListener listener)
Remove existing ChatLinkClickedListener |
void |
removeChatTransport(ChatTransport chatTransport)
Removes the given chat status state from the send via selector box. |
void |
removeTypingNotification()
Removes the typing notification message from the conversation panel. |
void |
requestFocusInWriteArea()
Requests the focus in the write message area. |
void |
sendButtonDoClick()
Sends current write area content. |
void |
sendFile(File file)
Sends the given file through the currently selected chat transport. |
void |
sendFile(File file,
SendFileConversationComponent fileComponent)
Sends the given file through the currently selected chat transport by using the given fileComponent to visualize the transfer process in the chat conversation panel. |
protected void |
sendInstantMessage()
Implements the ChatPanel.sendMessage method. |
protected void |
sendMessage()
Sends the text contained in the write area as an SMS message or an instance message depending on the "send SMS" check box. |
void |
sendSmsMessage()
Sends the text contained in the write area as an SMS message. |
void |
setChatSession(ChatSession chatSession)
Sets the chat session to associate to this chat panel. |
void |
setChatSubject(String subject)
Sets the given subject to this chat. |
void |
setChatVisible(boolean isVisible)
Brings the ChatWindow containing this ChatPanel to the front if isVisble is true; hides it, otherwise. |
void |
setContactName(ChatContact<?> chatContact,
String name)
Renames all occurrences of the given chatContact in this chat panel. |
void |
setDividerLocation(int location)
Sets the location of the split pane divider. |
void |
setMessage(String message)
Sets the given message as a message in the chat write area. |
void |
setSelectedChatTransport(ChatTransport chatTransport)
Selects the given chat transport in the send via box. |
void |
setShown(boolean isShown)
Marks this chat panel as shown or hidden. |
void |
setSmsSelected(boolean isSmsSelected)
Changes the "Send as SMS" check box state. |
void |
showFontChooserDialog()
Shows the font chooser dialog |
void |
statusChanged(FileTransferStatusChangeEvent event)
Handles file transfer status changed in order to remove completed file transfers from the list of active transfers. |
void |
updateChatContactStatus(ChatContact<?> chatContact,
String statusMessage)
Updates the contact status. |
void |
updateChatTransportStatus(ChatTransport chatTransport)
Updates the status of the given chat transport in the send via selector box and notifies the user for the status change. |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public int unreadMessageNumber
public static final int TYPING_NOTIFICATION_SUCCESSFULLY_SENT
public static final int TYPING_NOTIFICATION_SEND_FAILED
protected static final int MESSAGES_PER_PAGE
public ChatSession chatSession
| Constructor Detail |
|---|
public ChatPanel(ChatContainer chatContainer)
chatContainer - The parent window of this chat panel.| Method Detail |
|---|
public void setChatSession(ChatSession chatSession)
chatSession - the chat session to associate to this chat panelpublic ChatSession getChatSession()
public void dispose()
public ChatContainer getChatContainer()
public Window getConversationContainerWindow()
getConversationContainerWindow in interface ChatConversationContainerpublic void addTypingNotification(String typingNotification)
addTypingNotification in interface ChatConversationContainertypingNotification - the typing notification to showpublic void removeTypingNotification()
public ChatConversationPanel getChatConversationPanel()
public ChatWritePanel getChatWritePanel()
public String getRoleDescription(ChatRoomMemberRole role)
role - to role index to analyse
public void memberRoleChanged(ChatRoomMemberRoleChangeEvent evt)
memberRoleChanged in interface ChatRoomMemberRoleListenerevt - public void localUserRoleChanged(ChatRoomLocalUserRoleChangeEvent evt)
localUserRoleChanged in interface ChatRoomLocalUserRoleListenerevt - public void requestFocusInWriteArea()
public boolean isWriteAreaEmpty()
public void addMessage(String contactName,
long date,
String messageType,
String message,
String contentType)
ChatConversationPanel
for processing and appends it at the end of the conversationPanel
document.
addMessage in interface ChatcontactName - the name of the contact sending the messagedate - the time at which the message is sent or receivedmessageType - the type of the message. One of OUTGOING_MESSAGE
or INCOMING_MESSAGEmessage - the message textcontentType - the content type
public void addMessage(String contactName,
String displayName,
long date,
String messageType,
String message,
String contentType)
ChatConversationPanel
for processing and appends it at the end of the conversationPanel
document.
contactName - the name of the contact sending the messagedisplayName - the display name of the contactdate - the time at which the message is sent or receivedmessageType - the type of the message. One of OUTGOING_MESSAGE
or INCOMING_MESSAGEmessage - the message textcontentType - the content type
public void addMessage(String contactName,
long date,
String messageType,
String title,
String message,
String contentType)
ChatConversationPanel
for processing and appends it at the end of the conversationPanel
document.
contactName - the name of the contact sending the messagedate - the time at which the message is sent or receivedmessageType - the type of the message. One of OUTGOING_MESSAGE
or INCOMING_MESSAGEtitle - the title of the messagemessage - the message textcontentType - the content type
public void addErrorMessage(String contactName,
String message)
contactName - the name of the contact, for which the error occuredmessage - the error message
public void addErrorMessage(String contactName,
String title,
String message)
contactName - the name of the contact, for which the error occurredtitle - the title of the errormessage - the error messagepublic void refreshWriteArea()
public void addTextInWriteArea(String text)
text - The text to add.public String getTextFromWriteArea(String mimeType)
mimeType - the mime type
public void cut()
public void copy()
public void copyWriteArea()
public void paste()
public void sendButtonDoClick()
public boolean isShown()
public void setShown(boolean isShown)
isShown - TRUE to mark this chat panel as shown, FALSE - otherwisepublic void setChatVisible(boolean isVisible)
setChatVisible in interface ChatisVisible - true to bring the ChatWindow of this
ChatPanel to the front; false to close this
ChatPanelpublic boolean isChatFocused()
isChatFocused in interface Chatpublic void addChatEditorKeyListener(KeyListener l)
KeyListener to this Chat.
The KeyListener is used to inform other bundles when a user has
typed in the chat editor area.
addChatEditorKeyListener in interface Chatl - the KeyListener to addpublic void removeChatEditorKeyListener(KeyListener l)
KeyListener from this Chat.
The KeyListener is used to inform other bundles when a user has
typed in the chat editor area.
removeChatEditorKeyListener in interface Chatl - the ChatFocusListener to removepublic String getMessage()
getMessage in interface Chatpublic void setMessage(String message)
setMessage in interface Chatmessage - the text that would be set to the chat write area
public void sendFile(File file,
SendFileConversationComponent fileComponent)
file - the file to sendfileComponent - the file component to use for visualizationpublic void sendFile(File file)
file - the file to sendprotected void sendMessage()
public void sendSmsMessage()
protected void sendInstantMessage()
public long getFirstHistoryMsgTimestamp()
public long getLastHistoryMsgTimestamp()
public void loadHistory(String escapedMessageID)
escapedMessageID - the id of the message to be ignored;
null if no message is to be ignoredpublic void loadHistory()
loadHistory(String) with null for
escapedMessageID.
public void setSmsSelected(boolean isSmsSelected)
isSmsSelected - true to set the "Send as SMS" check box
selected, false - otherwise.
public void setContactName(ChatContact<?> chatContact,
String name)
setContactName in interface ChatSessionRendererchatContact - the contact to renamename - the new namepublic void addChatTransport(ChatTransport chatTransport)
addChatTransport in interface ChatSessionRendererchatTransport - the transport to addpublic void removeChatTransport(ChatTransport chatTransport)
removeChatTransport in interface ChatSessionRendererchatTransport - the transport to removepublic void setSelectedChatTransport(ChatTransport chatTransport)
chatTransport - the chat transport to be selectedpublic void updateChatTransportStatus(ChatTransport chatTransport)
updateChatTransportStatus in interface ChatSessionRendererchatTransport - the chatTransport to updatepublic void loadPreviousPageFromHistory()
public void loadNextPageFromHistory()
public void addChatContact(ChatContact<?> chatContact)
addChatContact in interface ChatSessionRendererchatContact - the contact to addpublic void removeChatContact(ChatContact<?> chatContact)
removeChatContact in interface ChatSessionRendererchatContact - the contact to removepublic void removeAllChatContacts()
removeAllChatContacts in interface ChatSessionRenderer
public void updateChatContactStatus(ChatContact<?> chatContact,
String statusMessage)
updateChatContactStatus in interface ChatSessionRendererchatContact - the chat contact to updatestatusMessage - the status message to showpublic void setChatSubject(String subject)
setChatSubject in interface ChatSessionRenderersubject - the subject to set
public void addIncomingFileTransferRequest(OperationSetFileTransfer fileTransferOpSet,
IncomingFileTransferRequest request,
Date date)
fileTransferOpSet - the file transfer operation setrequest - the request to display in the conversation paneldate - the date on which the request has been receivedpublic void addChatFocusListener(ChatFocusListener listener)
addChatFocusListener in interface Chatlistener - the listener that we'll be adding.public void removeChatFocusListener(ChatFocusListener listener)
removeChatFocusListener in interface Chatlistener - the listener to remove.public ChatTransport findFileTransferChatTransport()
public ChatTransport findInviteChatTransport()
public void inviteContacts(ChatTransport inviteChatTransport,
Collection<String> chatContacts,
String reason)
inviteChatTransport - the chat transport to use to send the invitechatContacts - the contacts to invitereason - the reason of the invitationpublic void fireChatFocusEvent(int eventID)
eventID - the type of the ChatFocusEventpublic void statusChanged(FileTransferStatusChangeEvent event)
statusChanged in interface FileTransferStatusListenerevent - the file transfer status change event the notified us for
the changepublic boolean containsActiveFileTransfers()
true if there are active file transfers, otherwise
returns false.
true if there are active file transfers, otherwise
returns falsepublic void cancelActiveFileTransfers()
public void setDividerLocation(int location)
location - the location of the divider given by the pixel count
between the left bottom corner and the left bottom divider locationpublic int getDividerLocation()
public int getDividerSize()
public void addActiveFileTransfer(String id,
Object descriptor)
id - the identifier of the file transfer to adddescriptor - the descriptor of the file transferpublic void removeActiveFileTransfer(String id)
id - the identifier of the file transfer to removepublic void addChatEditorMenuListener(ChatMenuListener l)
ChatMenuListener to this Chat.
The ChatMenuListener is used to determine menu elements
that should be added on right clicks.
addChatEditorMenuListener in interface Chatl - the ChatMenuListener to addpublic void addChatEditorCaretListener(CaretListener l)
CaretListener to this Chat.
The CaretListener is used to inform other bundles when a user has
moved the caret in the chat editor area.
addChatEditorCaretListener in interface Chatl - the CaretListener to addpublic void addChatEditorDocumentListener(DocumentListener l)
DocumentListener to this Chat.
The DocumentListener is used to inform other bundles when a user has
modified the document in the chat editor area.
addChatEditorDocumentListener in interface Chatl - the DocumentListener to addpublic void removeChatEditorCaretListener(CaretListener l)
CaretListener from this Chat.
The CaretListener is used to inform other bundles when a user has
moved the caret in the chat editor area.
removeChatEditorCaretListener in interface Chatl - the CaretListener to removepublic void removeChatEditorMenuListener(ChatMenuListener l)
ChatMenuListener to this Chat.
The ChatMenuListener is used to determine menu elements
that should be added on right clicks.
removeChatEditorMenuListener in interface Chatl - the ChatMenuListener to addpublic void removeChatEditorDocumentListener(DocumentListener l)
DocumentListener from this Chat.
The DocumentListener is used to inform other bundles when a user has
modified the document in the chat editor area.
removeChatEditorDocumentListener in interface Chatl - the DocumentListener to removepublic void addChatHistoryListener(ChatHistoryListener l)
l - the ChatHistoryListener to addpublic void removeChatHistoryListener(ChatHistoryListener l)
l - the ChatHistoryListener to removepublic Highlighter getHighlighter()
Highlighter used in rendering the chat editor.
getHighlighter in interface Chatpublic int getCaretPosition()
getCaretPosition in interface Chatpublic void promptRepaint()
promptRepaint in interface Chatpublic void showFontChooserDialog()
public void loadSkin()
loadSkin in interface Skinnablepublic void chatRoomPropertyChanged(ChatRoomMemberPropertyChangeEvent event)
chatRoomPropertyChanged in interface ChatRoomMemberPropertyChangeListenerevent - a ChatRoomMemberPropertyChangeEvent which carries
the specific of the changepublic void addChatLinkClickedListener(ChatLinkClickedListener listener)
addChatLinkClickedListener in interface Chatlistener - ChatLinkClickedListenerpublic void removeChatLinkClickedListener(ChatLinkClickedListener listener)
removeChatLinkClickedListener in interface Chatlistener - ChatLinkClickedListener
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||