ggz.ui
Class ChatPanel

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 ggz.ui.ChatPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, java.util.prefs.PreferenceChangeListener, javax.accessibility.Accessible

public class ChatPanel
extends javax.swing.JPanel
implements java.util.prefs.PreferenceChangeListener

See Also:
Serialized Form

Nested Class Summary
 
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  ChatAction chatAction
           
protected  javax.swing.JTextPane chatArea
           
protected static javax.swing.text.StyleContext emoticons
           
protected static java.util.HashSet friendsList
           
protected  boolean isAutoScroll
           
protected  javax.swing.JTextField textField
           
 
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
ChatPanel(ChatAction chatAction)
          Any code that creates an instance of this class must call dispose() so that this instance can be made ready for garbage collection.
 
Method Summary
 void appendChat(ChatType type, java.lang.String sender, java.lang.String message, java.lang.String me)
           
 void appendChat(java.lang.String sender, java.lang.String message, java.lang.String me)
           
 void appendCommandText(java.lang.String message)
           
 void appendFriendsList()
           
 void appendIgnoreList()
           
 void appendInfo(java.lang.String message)
           
protected  void checkAutoScroll()
           
 void clearChat()
           
 void clearMessage()
           
 void dispose()
          Stops listening for preference change events so that this instance can be garbage collected.
 java.lang.String getMessage()
           
protected  void insertWithEmotes(javax.swing.text.StyledDocument doc, java.lang.String text, javax.swing.text.AttributeSet style)
           
static boolean isFriend(java.lang.String handle)
           
static boolean isIgnored(java.lang.String handle)
           
 void preferenceChange(java.util.prefs.PreferenceChangeEvent evt)
           
 void sendBeep(java.lang.String handle)
           
 void toggleFriend(java.lang.String handle)
           
 void toggleIgnore(java.lang.String handle)
           
 
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, 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, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

chatArea

protected javax.swing.JTextPane chatArea

textField

protected javax.swing.JTextField textField

chatAction

protected ChatAction chatAction

isAutoScroll

protected boolean isAutoScroll

friendsList

protected static java.util.HashSet friendsList

emoticons

protected static javax.swing.text.StyleContext emoticons
Constructor Detail

ChatPanel

public ChatPanel(ChatAction chatAction)
Any code that creates an instance of this class must call dispose() so that this instance can be made ready for garbage collection.

Parameters:
chatAction - the action that sends the chat.
Method Detail

dispose

public void dispose()
Stops listening for preference change events so that this instance can be garbage collected.


appendInfo

public void appendInfo(java.lang.String message)

appendCommandText

public void appendCommandText(java.lang.String message)

appendChat

public void appendChat(java.lang.String sender,
                       java.lang.String message,
                       java.lang.String me)

appendChat

public void appendChat(ChatType type,
                       java.lang.String sender,
                       java.lang.String message,
                       java.lang.String me)

insertWithEmotes

protected void insertWithEmotes(javax.swing.text.StyledDocument doc,
                                java.lang.String text,
                                javax.swing.text.AttributeSet style)
                         throws javax.swing.text.BadLocationException
Throws:
javax.swing.text.BadLocationException

checkAutoScroll

protected void checkAutoScroll()

getMessage

public java.lang.String getMessage()

clearMessage

public void clearMessage()

clearChat

public void clearChat()

toggleIgnore

public void toggleIgnore(java.lang.String handle)

isIgnored

public static boolean isIgnored(java.lang.String handle)

appendIgnoreList

public void appendIgnoreList()

sendBeep

public void sendBeep(java.lang.String handle)
              throws java.io.IOException
Throws:
java.io.IOException

toggleFriend

public void toggleFriend(java.lang.String handle)

isFriend

public static boolean isFriend(java.lang.String handle)

appendFriendsList

public void appendFriendsList()

preferenceChange

public void preferenceChange(java.util.prefs.PreferenceChangeEvent evt)
Specified by:
preferenceChange in interface java.util.prefs.PreferenceChangeListener