Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

plugins.Messenger
Class ChatFrame  view ChatFrame download ChatFrame.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Frame
                  extended byjavax.swing.JFrame
                      extended byplugins.Messenger.ChatFrame
All Implemented Interfaces:
javax.accessibility.Accessible, ConversationListener, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants

public class ChatFrame
extends javax.swing.JFrame
implements ConversationListener


Nested Class Summary
 class ChatFrame.CopyAction
           
 class ChatFrame.CutAction
           
static class ChatFrame.JUserStatusPanel
           
 class ChatFrame.PasteAction
           
 class ChatFrame.SaveOutputAction
           
 class ChatFrame.SendAction
           
 class ChatFrame.TypingForwarder
           
 
Nested classes inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  dexter.swingExtensions.ChatDocument chatDocument
           
private  Conversation conversation
           
private  java.text.DateFormat format
           
private  javax.swing.JMenuItem jCopyItem
           
private  javax.swing.JPopupMenu jCopyPopupMenu
           
private  javax.swing.JMenuItem jCutItem
           
private  javax.swing.JPopupMenu jEditPopupMenu
           
private  javax.swing.JPanel jInputPanel
           
private  javax.swing.JScrollPane jInputScrollPane
           
private  javax.swing.JTextPane jInputTextPane
           
private  javax.swing.JPanel jInteractionPanel
           
private  javax.swing.JMenuBar jMenuBar
           
private  javax.swing.JMenuItem jOutputCopyItem
           
private  javax.swing.JMenuItem jOutputSaveItem
           
private  javax.swing.JScrollPane jOutputScrollPane
           
private  javax.swing.JTextPane jOutputTextPane
           
private  javax.swing.JMenuItem jPasteItem
           
private  javax.swing.JButton jSendButton
           
private  javax.swing.JButton jSmileyButton
           
private  javax.swing.JPanel jStatusPanel
           
private  javax.swing.JSplitPane jTextSplitPane
           
private  javax.swing.JToolBar jToolBox
           
private  javax.swing.Action sendAction
           
private  java.util.Map statusPanels
           
private  ChatFrame.TypingForwarder typingForwarder
           
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Window
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ChatFrame()
          Creates new form ChatFrame
 
Method Summary
protected  void createDefaultActions()
           
protected  dexter.swingExtensions.ChatDocument createDefaultChatDocument()
           
protected  void enableChat(boolean enable)
           
private  void exitForm(java.awt.event.WindowEvent evt)
          Exit the Application
 Conversation getConversation()
          Getter for property conversation.
 javax.swing.text.Document getInputDocument()
           
 javax.swing.JToolBar getJToolBox()
          Getter for property jToolBox.
protected  ChatFrame.JUserStatusPanel getUserStatusPanel(java.lang.String account)
           
private  void initComponents()
          This method is called from within the constructor to initialize the form.
private  void jInputTextPaneMousePressed(java.awt.event.MouseEvent evt)
           
private  void jInputTextPaneMouseReleased(java.awt.event.MouseEvent evt)
           
private  void jOutputTextPaneMousePressed(java.awt.event.MouseEvent evt)
           
private  void jOutputTextPaneMouseReleased(java.awt.event.MouseEvent evt)
           
static void main(java.lang.String[] args)
           
private  void maybePopupCopyMenu(java.awt.event.MouseEvent evt)
           
private  void maybePopupEditMenu(java.awt.event.MouseEvent evt)
           
 void messageReceived(java.lang.String account, java.lang.String nick, java.lang.String msg)
           
protected  void registerKeyStrokes()
           
private  void saveText(java.lang.String text)
           
protected  void scrollToBottom()
           
protected  void send(java.lang.String s)
           
 void sendMessage()
           
 void setConversation(Conversation conversation)
          Setter for property conversation.
 void setJToolBox(javax.swing.JToolBar jToolBox)
          Setter for property jToolBox.
 void setSmileyButtonAction(javax.swing.Action action)
           
 void setToolBox(javax.swing.JToolBar toolBox)
          Setter for property toolBox.
 void setToolMenu(javax.swing.JMenu jPluginMenu)
           
 void userJoined(java.lang.String account, java.lang.String nick)
           
 void userLeft(java.lang.String account)
          If chatting with more than just one Partner a message will be printed out that a Partner has left the chat.
 void userTyping(java.lang.String account, java.lang.String nick)
           
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getPreferredSize, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusOwner, getGraphicsConfiguration, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, swapComponents, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

conversation

private Conversation conversation

chatDocument

private dexter.swingExtensions.ChatDocument chatDocument

statusPanels

private java.util.Map statusPanels

sendAction

private javax.swing.Action sendAction

typingForwarder

private ChatFrame.TypingForwarder typingForwarder

format

private java.text.DateFormat format

jOutputSaveItem

private javax.swing.JMenuItem jOutputSaveItem

jCutItem

private javax.swing.JMenuItem jCutItem

jInteractionPanel

private javax.swing.JPanel jInteractionPanel

jToolBox

private javax.swing.JToolBar jToolBox

jInputScrollPane

private javax.swing.JScrollPane jInputScrollPane

jTextSplitPane

private javax.swing.JSplitPane jTextSplitPane

jCopyPopupMenu

private javax.swing.JPopupMenu jCopyPopupMenu

jOutputScrollPane

private javax.swing.JScrollPane jOutputScrollPane

jCopyItem

private javax.swing.JMenuItem jCopyItem

jInputTextPane

private javax.swing.JTextPane jInputTextPane

jStatusPanel

private javax.swing.JPanel jStatusPanel

jSmileyButton

private javax.swing.JButton jSmileyButton

jInputPanel

private javax.swing.JPanel jInputPanel

jPasteItem

private javax.swing.JMenuItem jPasteItem

jOutputCopyItem

private javax.swing.JMenuItem jOutputCopyItem

jOutputTextPane

private javax.swing.JTextPane jOutputTextPane

jMenuBar

private javax.swing.JMenuBar jMenuBar

jSendButton

private javax.swing.JButton jSendButton

jEditPopupMenu

private javax.swing.JPopupMenu jEditPopupMenu
Constructor Detail

ChatFrame

public ChatFrame()
Creates new form ChatFrame

Method Detail

registerKeyStrokes

protected void registerKeyStrokes()

createDefaultActions

protected void createDefaultActions()

createDefaultChatDocument

protected dexter.swingExtensions.ChatDocument createDefaultChatDocument()

initComponents

private void initComponents()
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.


jInputTextPaneMousePressed

private void jInputTextPaneMousePressed(java.awt.event.MouseEvent evt)

jInputTextPaneMouseReleased

private void jInputTextPaneMouseReleased(java.awt.event.MouseEvent evt)

jOutputTextPaneMouseReleased

private void jOutputTextPaneMouseReleased(java.awt.event.MouseEvent evt)

jOutputTextPaneMousePressed

private void jOutputTextPaneMousePressed(java.awt.event.MouseEvent evt)

maybePopupEditMenu

private void maybePopupEditMenu(java.awt.event.MouseEvent evt)

maybePopupCopyMenu

private void maybePopupCopyMenu(java.awt.event.MouseEvent evt)

exitForm

private void exitForm(java.awt.event.WindowEvent evt)
Exit the Application


main

public static void main(java.lang.String[] args)

sendMessage

public void sendMessage()

send

protected void send(java.lang.String s)

scrollToBottom

protected void scrollToBottom()

enableChat

protected void enableChat(boolean enable)

messageReceived

public void messageReceived(java.lang.String account,
                            java.lang.String nick,
                            java.lang.String msg)
Specified by:
messageReceived in interface ConversationListener

userJoined

public void userJoined(java.lang.String account,
                       java.lang.String nick)
Specified by:
userJoined in interface ConversationListener

getUserStatusPanel

protected ChatFrame.JUserStatusPanel getUserStatusPanel(java.lang.String account)

userTyping

public void userTyping(java.lang.String account,
                       java.lang.String nick)
Specified by:
userTyping in interface ConversationListener

userLeft

public void userLeft(java.lang.String account)
If chatting with more than just one Partner a message will be printed out that a Partner has left the chat. If you chat with just one Person - nothing will happen.


setToolBox

public void setToolBox(javax.swing.JToolBar toolBox)
Setter for property toolBox.


setToolMenu

public void setToolMenu(javax.swing.JMenu jPluginMenu)

getJToolBox

public javax.swing.JToolBar getJToolBox()
Getter for property jToolBox.


setJToolBox

public void setJToolBox(javax.swing.JToolBar jToolBox)
Setter for property jToolBox.


setSmileyButtonAction

public void setSmileyButtonAction(javax.swing.Action action)

getInputDocument

public javax.swing.text.Document getInputDocument()

getConversation

public Conversation getConversation()
Getter for property conversation.


setConversation

public void setConversation(Conversation conversation)
Setter for property conversation.


saveText

private void saveText(java.lang.String text)