Class ChatPanel

    • Field Detail

      • icons

        protected static final javax.swing.UIDefaults icons
        The icons.
      • smileys

        protected static final java.util.List<java.lang.String> smileys
      • lf

        public static final java.lang.String lf
        The linefeed separator.
      • df

        public final java.text.DateFormat df
        The time format.
      • NOTIFICATION_NEW_USER

        public static final java.lang.String NOTIFICATION_NEW_USER
        The notification sound for a newly online user.
        See Also:
        Constant Field Values
      • NOTIFICATION_NEW_MSG

        public static final java.lang.String NOTIFICATION_NEW_MSG
        The notification sound for a new message.
        See Also:
        Constant Field Values
      • NOTIFICATION_MSG_FAILED

        public static final java.lang.String NOTIFICATION_MSG_FAILED
        The notification sound for a failed message.
        See Also:
        Constant Field Values
      • NOTIFICATION_NEW_FILE

        public static final java.lang.String NOTIFICATION_NEW_FILE
        The notification sound for an incoming file request.
        See Also:
        Constant Field Values
      • NOTIFICATION_FILE_COMPLETE

        public static final java.lang.String NOTIFICATION_FILE_COMPLETE
        The notification sound for a successfully completed file.
        See Also:
        Constant Field Values
      • NOTIFICATION_FILE_ABORT

        public static final java.lang.String NOTIFICATION_FILE_ABORT
        The notification sound for an aborted or failed file transfer.
        See Also:
        Constant Field Values
      • NOTIFICATION_SOUNDS

        protected static final java.util.Map<java.lang.String,​java.lang.String> NOTIFICATION_SOUNDS
        The default notification sounds.
      • panel

        protected javax.swing.JPanel panel
        The chat panel.
      • chatarea

        protected javax.swing.JTextPane chatarea
        The text area.
      • usertable

        protected javax.swing.JTable usertable
        The user table.
      • typing

        protected boolean typing
        The typing state.
      • away

        protected boolean away
        The away state.
      • dtable

        protected javax.swing.JTable dtable
        The download table.
      • utable

        protected javax.swing.JTable utable
        The upload table.
      • tpane

        protected javax.swing.JTabbedPane tpane
        The tabbed pane.
      • refreshtimer

        protected javax.swing.Timer refreshtimer
        The refresh timer.
      • awaytimer

        protected javax.swing.Timer awaytimer
        The away timer.
      • listpan

        protected JSplitPanel listpan
        The split panel on left hand side.
      • horsplit

        protected JSplitPanel horsplit
        The main split panel between left and right.
      • sound

        protected boolean sound
        The sound flag.
      • autorefresh

        protected boolean autorefresh
        The autorefresh flag.
      • notificationsounds

        protected java.util.Map<java.lang.String,​java.lang.String> notificationsounds
        The custom notification sounds.
      • filechooser

        protected javax.swing.JFileChooser filechooser
        The file chooser (created on demand, if local).
      • rfilechooser

        protected RemoteFileChooser rfilechooser
        The remote file chooser (created on demand, if remote).
      • dialogs

        protected java.util.Map<TransferInfo,​javax.swing.JComponent> dialogs
        Map for panels of open accept dialogs to close when transfer has been accepted/rejected/timeouted in background.
      • reqcnt

        protected int reqcnt
        The message counter to differentiate sent messages.
      • icontimer

        protected javax.swing.Timer icontimer
        The timer for the flashing chat icon.
      • playing

        protected boolean playing
        Flag to indicate that a sound is playing.
    • Constructor Detail

      • ChatPanel

        public ChatPanel()
    • Method Detail

      • updateRefreshTimer

        protected void updateRefreshTimer()
        Start or stop the refresh timer, if necessary.
      • setAway

        protected void setAway​(boolean away)
        Change the status to away and post a change, if necessary.
      • tell

        public IFuture<java.lang.Void> tell​(java.lang.String text)
        Send a message.
        Parameters:
        text - The text.
      • postStatus

        public IFuture<java.lang.Void> postStatus()
        Post the local state to available chatters
      • addMessage

        public void addMessage​(IComponentIdentifier cid,
                               java.lang.String text,
                               java.lang.String nick,
                               boolean privatemessage,
                               boolean sendfailure)
        Add a message to the text area.
      • setUserState

        public void setUserState​(IComponentIdentifier cid,
                                 java.lang.Boolean online,
                                 java.lang.Boolean typing,
                                 java.lang.Boolean away,
                                 java.lang.String nickname,
                                 byte[] image)
        Add a user or change its state.
      • acceptFile

        public IFuture<java.lang.String> acceptFile​(TransferInfo ti)
        Open dialog and check if user wants to receive the file.
        Returns:
        The path name to store the file, if accepted.
      • notifyChatEvent

        protected void notifyChatEvent​(java.lang.String type,
                                       IComponentIdentifier source,
                                       java.lang.Object value,
                                       boolean quiet)
        Show a status message and optionally play a notification sound.
      • playSound

        protected void playSound​(java.lang.String type,
                                 boolean verbose)
        Play the notification sound for the selected event.
        Parameters:
        type - The notification event.
      • updateTransfer

        public void updateTransfer​(TransferInfo fi)
        Update the fileinfo in the upload/download area.
      • append

        public static void append​(java.awt.Color c,
                                  java.lang.String s,
                                  javax.swing.JTextPane p)
        Append text.
      • doAppend

        public static void doAppend​(java.awt.Color c,
                                    java.lang.String s,
                                    javax.swing.JTextPane p)
      • getNotificationSound

        public java.lang.String getNotificationSound​(java.lang.String type)
        Get the notification sound.