JXTA

net.jxta.instantp2p.desktop
Class Messaging

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--net.jxta.instantp2p.desktop.Messaging

public class Messaging
extends java.awt.Panel
implements MessageBoard, java.awt.event.ActionListener, java.awt.event.ItemListener

See Also:
Serialized Form

Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
Messaging(net.jxta.peergroup.PeerGroup group, java.lang.String chatString, PeerGroupPanel pgPanel)
          Creates a new messaging panel.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
          Called if either the login or logout button was pressed or an action event occured in tthe sendText box, i.e.
 void debug_MSG(java.lang.String str)
          Displays the str as an debug message in the main message text area.
 boolean displayDialog(java.lang.String name, java.lang.String pipeID)
          Displays a dialog if we receive a chat proposal on a secure channel.
 void displayMessage(java.lang.String str)
          Displays the message contained in str in the amin TextArea
 void error(java.lang.String str)
          Displays the str as an error message in the main message text area.
 void info(java.lang.String str)
          Displays the str as info message in the main message text area.
 void itemStateChanged(java.awt.event.ItemEvent evt)
          Called if the user changes the secure status of the chat via toggleing the secure chat checkbox.
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setCursor, setFont, setLayout, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Messaging

public Messaging(net.jxta.peergroup.PeerGroup group,
                 java.lang.String chatString,
                 PeerGroupPanel pgPanel)
Creates a new messaging panel. This is a GroupChat or a Chat, depending on the value of chatString. A new instance of Chat or GroupChat is created, which registeres itself as a PeerListener to pgPanel.
Parameters:
group - the current peergroup
chatString - the type of chat panel beeing created.
pgPanel - the panel displaying the peers, the newly created Chat instance will register itself as a PeerListener to this panel.
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Called if either the login or logout button was pressed or an action event occured in tthe sendText box, i.e. the user wants to send a message.
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
evt - the triggering ActionEvent

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent evt)
Called if the user changes the secure status of the chat via toggleing the secure chat checkbox. The member variable

error

public void error(java.lang.String str)
Displays the str as an error message in the main message text area.
Specified by:
error in interface MessageBoard
Parameters:
str - the error to display

debug_MSG

public void debug_MSG(java.lang.String str)
Displays the str as an debug message in the main message text area. Currently not implemented.
Specified by:
debug_MSG in interface MessageBoard
Parameters:
str - the debug message to display

info

public void info(java.lang.String str)
Displays the str as info message in the main message text area.
Specified by:
info in interface MessageBoard
Parameters:
str - the info to display

displayMessage

public void displayMessage(java.lang.String str)
Displays the message contained in str in the amin TextArea
Specified by:
displayMessage in interface MessageBoard
Parameters:
str - the message to display

displayDialog

public boolean displayDialog(java.lang.String name,
                             java.lang.String pipeID)
Displays a dialog if we receive a chat proposal on a secure channel. If the user presses Accept in that dialog, we return true, false otherwise. The secured Checkbox is updated accordingly
Specified by:
displayDialog in interface MessageBoard
Parameters:
name - the name of the peer requesting the chat
pipeID - the pipeID which represents the secure channel
Returns:
true if the user accepts the secure chat, false otherwise

JXTA