| 
||||||||||
| 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
org.jivesoftware.spark.component.BackgroundPanel
org.jivesoftware.spark.ui.ChatRoom
org.jivesoftware.spark.ui.rooms.ChatRoomImpl
public class ChatRoomImpl
This is the Person to Person implementation of ChatRoom
 This room only allows for 1 to 1 conversations.
| Nested Class Summary | 
|---|
| Nested classes/interfaces inherited from class org.jivesoftware.spark.ui.ChatRoom | 
|---|
ChatRoom.ChatToolBar | 
| Nested classes/interfaces inherited from class javax.swing.JPanel | 
|---|
javax.swing.JPanel.AccessibleJPanel | 
| Nested classes/interfaces inherited from class javax.swing.JComponent | 
|---|
javax.swing.JComponent.AccessibleJComponent | 
| Nested classes/interfaces inherited from class java.awt.Container | 
|---|
java.awt.Container.AccessibleAWTContainer | 
| Nested classes/interfaces inherited from class java.awt.Component | 
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.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 | |
|---|---|
ChatRoomImpl(java.lang.String participantJID,
             java.lang.String participantNickname,
             java.lang.String title)
Constructs a 1-to-1 ChatRoom.  | 
|
| Method Summary | |
|---|---|
 void | 
addMessageEventListener(MessageEventListener listener)
 | 
 void | 
closeChatRoom()
Close the ChatRoom.  | 
 void | 
connectionClosed()
 | 
 void | 
connectionClosedOnError(java.lang.Exception ex)
 | 
 void | 
fireOutgoingMessageSending(org.jivesoftware.smack.packet.Message message)
 | 
 void | 
fireReceivingIncomingMessage(org.jivesoftware.smack.packet.Message message)
 | 
 javax.swing.Icon | 
getAlternativeIcon()
Returns the alternative icon.  | 
 org.jivesoftware.smack.packet.Message.Type | 
getChatType()
Returns the Message.Type specific to this
 chat room. | 
 java.lang.String | 
getJID()
Returns the users full jid (ex.  | 
 long | 
getLastActivity()
The last time this chat room sent or receieved a message.  | 
 java.util.Collection | 
getMessageEventListeners()
 | 
 java.lang.String | 
getParticipantJID()
 | 
 java.lang.String | 
getParticipantNickname()
Returns the nickname of the user chatting with.  | 
 org.jivesoftware.smack.packet.Presence | 
getPresence()
Returns the current presence of the client this room was created for.  | 
 java.lang.String | 
getRoomname()
Get the roomname to use for this ChatRoom.  | 
 java.lang.String | 
getRoomTitle()
Returns the title of this room to use.  | 
 javax.swing.Icon | 
getTabIcon()
Get the Icon to be used in the tab holding
 this ChatRoom. | 
 java.lang.String | 
getTabTitle()
Get the title to use in the tab holding this ChatRoom.  | 
 void | 
insertMessage(org.jivesoftware.smack.packet.Message message)
The main entry point when receiving any messages.  | 
 void | 
insertUpdate(javax.swing.event.DocumentEvent e)
The current SendField has been updated somehow.  | 
 boolean | 
isActive()
Returns whether or not this ChatRoom is active.  | 
 boolean | 
isIconHandler()
 | 
 void | 
leaveChatRoom()
Disable the chat room.  | 
 void | 
processPacket(org.jivesoftware.smack.packet.Packet packet)
Process incoming packets.  | 
 void | 
reconnectionSuccessful()
 | 
 void | 
removeMessageEventListener(MessageEventListener listener)
 | 
 void | 
sendMessage()
Creates and sends a message object from the text in the Send Field, using the default nickname specified in your Chat Preferences.  | 
 void | 
sendMessage(org.jivesoftware.smack.packet.Message message)
Sends a message to the appropriate jid.  | 
 void | 
sendMessage(java.lang.String text)
Creates a Message object from the given text and delegates to the room for sending.  | 
 void | 
setAlternativeIcon(javax.swing.Icon icon)
Sets the alternative icon to use for the chat room.  | 
 void | 
setIconHandler(boolean iconHandler)
 | 
 void | 
setRoomTitle(java.lang.String roomTitle)
 | 
 void | 
setSendTypingNotification(boolean isSendTypingNotification)
 | 
 void | 
setTabIcon(javax.swing.Icon icon)
 | 
 void | 
setTabTitle(java.lang.String tabTitle)
 | 
 void | 
showTyping(boolean typing)
Show the typing notification.  | 
| Methods inherited from class org.jivesoftware.spark.component.BackgroundPanel | 
|---|
paintComponent | 
| 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, 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, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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 | 
|---|
public ChatRoomImpl(java.lang.String participantJID,
                    java.lang.String participantNickname,
                    java.lang.String title)
participantJID - the participants jid to chat with.participantNickname - the nickname of the participant.title - the title of the room.| Method Detail | 
|---|
public void closeChatRoom()
ChatRoom
closeChatRoom in class ChatRoompublic void sendMessage()
ChatRoom
sendMessage in class ChatRoompublic void sendMessage(java.lang.String text)
ChatRoom
sendMessage in class ChatRoomtext - the text to send.public void sendMessage(org.jivesoftware.smack.packet.Message message)
sendMessage in class ChatRoommessage - the message to send.public java.lang.String getRoomname()
ChatRoom
getRoomname in class ChatRoompublic javax.swing.Icon getTabIcon()
ChatRoomIcon to be used in the tab holding
 this ChatRoom.
getTabIcon in class ChatRoomIcon to usepublic void setTabIcon(javax.swing.Icon icon)
public java.lang.String getTabTitle()
ChatRoom
getTabTitle in class ChatRoompublic void setTabTitle(java.lang.String tabTitle)
public void setRoomTitle(java.lang.String roomTitle)
public java.lang.String getRoomTitle()
ChatRoom
getRoomTitle in class ChatRoompublic org.jivesoftware.smack.packet.Message.Type getChatType()
ChatRoomMessage.Type specific to this
 chat room.
 GroupChat is Message.Type.GROUP_CHAT
 Normal Chat is Message.TYPE.NORMAL
getChatType in class ChatRoompublic void leaveChatRoom()
ChatRoom
leaveChatRoom in class ChatRoompublic boolean isActive()
ChatRoom
isActive in class ChatRoompublic java.lang.String getParticipantJID()
public java.lang.String getJID()
public void processPacket(org.jivesoftware.smack.packet.Packet packet)
processPacket in interface org.jivesoftware.smack.PacketListenerprocessPacket in class ChatRoompacket - - the packet to processpublic java.lang.String getParticipantNickname()
public void insertUpdate(javax.swing.event.DocumentEvent e)
insertUpdate in interface javax.swing.event.DocumentListenerinsertUpdate in class ChatRoome - - the DocumentEvent to respond to.public void insertMessage(org.jivesoftware.smack.packet.Message message)
ChatRoom
insertMessage in class ChatRoommessage - - the message receieved.public void addMessageEventListener(MessageEventListener listener)
public void removeMessageEventListener(MessageEventListener listener)
public java.util.Collection getMessageEventListeners()
public void fireOutgoingMessageSending(org.jivesoftware.smack.packet.Message message)
public void fireReceivingIncomingMessage(org.jivesoftware.smack.packet.Message message)
public void showTyping(boolean typing)
typing - true if the typing notification should show, otherwise hide it.public long getLastActivity()
getLastActivity in class ChatRoompublic org.jivesoftware.smack.packet.Presence getPresence()
public boolean isIconHandler()
public void setIconHandler(boolean iconHandler)
public void setSendTypingNotification(boolean isSendTypingNotification)
public void connectionClosed()
connectionClosed in interface org.jivesoftware.smack.ConnectionListenerconnectionClosed in class ChatRoompublic void connectionClosedOnError(java.lang.Exception ex)
connectionClosedOnError in interface org.jivesoftware.smack.ConnectionListenerconnectionClosedOnError in class ChatRoompublic void reconnectionSuccessful()
reconnectionSuccessful in interface org.jivesoftware.smack.ConnectionListenerreconnectionSuccessful in class ChatRoompublic void setAlternativeIcon(javax.swing.Icon icon)
icon - the alternative iconpublic javax.swing.Icon getAlternativeIcon()
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||