public class ChatPanel
extends jadex.base.gui.componentviewer.AbstractServiceViewerPanel<jadex.bridge.service.types.chat.IChatGuiService>
Modifier and Type | Class and Description |
---|---|
class |
ChatPanel.FileTableModel
Table model for up/downloads.
|
class |
ChatPanel.FileTransferMouseAdapter
Mouse listener that allows to manipulate transfers.
|
class |
ChatPanel.UserTableModel
Table model for list of users.
|
Modifier and Type | Field and Description |
---|---|
protected boolean |
autorefresh
The autorefresh flag.
|
protected boolean |
away
The away state.
|
protected javax.swing.Timer |
awaytimer
The away timer.
|
protected javax.swing.JTextPane |
chatarea
The text area.
|
java.text.DateFormat |
df
The time format.
|
protected java.util.Map<jadex.bridge.service.types.chat.TransferInfo,javax.swing.JComponent> |
dialogs
Map for panels of open accept dialogs to close when transfer has been accepted/rejected/timeouted in background.
|
protected javax.swing.JTable |
dtable
The download table.
|
protected javax.swing.JFileChooser |
filechooser
The file chooser (created on demand, if local).
|
protected jadex.commons.gui.JSplitPanel |
horsplit
The main split panel between left and right.
|
protected static javax.swing.UIDefaults |
icons
The icons.
|
protected javax.swing.Timer |
icontimer
The timer for the flashing chat icon.
|
static java.lang.String |
lf
The linefeed separator.
|
protected jadex.commons.gui.JSplitPanel |
listpan
The split panel on left hand side.
|
static java.lang.String |
NOTIFICATION_FILE_ABORT
The notification sound for an aborted or failed file transfer.
|
static java.lang.String |
NOTIFICATION_FILE_COMPLETE
The notification sound for a successfully completed file.
|
static java.lang.String |
NOTIFICATION_MSG_FAILED
The notification sound for a failed message.
|
static java.lang.String |
NOTIFICATION_NEW_FILE
The notification sound for an incoming file request.
|
static java.lang.String |
NOTIFICATION_NEW_MSG
The notification sound for a new message.
|
static java.lang.String |
NOTIFICATION_NEW_USER
The notification sound for a newly online user.
|
protected static java.util.Map<java.lang.String,java.lang.String> |
NOTIFICATION_SOUNDS
The default notification sounds.
|
protected java.util.Map<java.lang.String,java.lang.String> |
notificationsounds
The custom notification sounds.
|
protected javax.swing.JPanel |
panel
The chat panel.
|
protected boolean |
playing
Flag to indicate that a sound is playing.
|
protected javax.swing.Timer |
refreshtimer
The refresh timer.
|
protected int |
reqcnt
The message counter to differentiate sent messages.
|
protected jadex.base.gui.RemoteFileChooser |
rfilechooser
The remote file chooser (created on demand, if remote).
|
protected static java.util.List<java.lang.String> |
smileys |
protected boolean |
sound
The sound flag.
|
protected jadex.commons.future.ISubscriptionIntermediateFuture<jadex.bridge.service.types.chat.ChatEvent> |
subscription
Registration at the service.
|
protected javax.swing.JTabbedPane |
tpane
The tabbed pane.
|
protected boolean |
typing
The typing state.
|
protected ChatPanel.UserTableModel |
usermodel |
protected javax.swing.JTable |
usertable
The user table.
|
protected javax.swing.JTable |
utable
The upload table.
|
Constructor and Description |
---|
ChatPanel() |
Modifier and Type | Method and Description |
---|---|
jadex.commons.future.IFuture<java.lang.String> |
acceptFile(jadex.bridge.service.types.chat.TransferInfo ti)
Open dialog and check if user wants to receive the file.
|
void |
addMessage(jadex.bridge.IComponentIdentifier cid,
java.lang.String text,
java.lang.String nick,
boolean privatemessage,
boolean sendfailure)
Add a message to the text area.
|
static void |
append(java.awt.Color c,
java.lang.String s,
javax.swing.JTextPane p)
Append text.
|
static void |
doAppend(java.awt.Color c,
java.lang.String s,
javax.swing.JTextPane p) |
javax.swing.JComponent |
getComponent()
Get the plugin view.
|
java.lang.String |
getNotificationSound(java.lang.String type)
Get the notification sound.
|
jadex.commons.future.IFuture<jadex.commons.Properties> |
getProperties()
Write current state into properties.
|
jadex.commons.future.IFuture<java.lang.Void> |
init(jadex.base.gui.plugin.IControlCenter jcc,
jadex.bridge.service.IService service)
Called once to initialize the panel.
|
protected void |
notifyChatEvent(java.lang.String type,
jadex.bridge.IComponentIdentifier source,
java.lang.Object value,
boolean quiet)
Show a status message and optionally play a notification sound.
|
protected void |
playSound(java.lang.String type,
boolean verbose)
Play the notification sound for the selected event.
|
jadex.commons.future.IFuture<java.lang.Void> |
postStatus()
Post the local state to available chatters
|
protected void |
setAway(boolean away)
Change the status to away and post a change, if necessary.
|
jadex.commons.future.IFuture<java.lang.Void> |
setProperties(jadex.commons.Properties props)
Update from given properties.
|
void |
setUserState(jadex.bridge.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.
|
jadex.commons.future.IFuture<java.lang.Void> |
shutdown()
Informs the panel that it should stop all its computation
|
jadex.commons.future.IFuture<java.lang.Void> |
tell(java.lang.String text)
Send a message.
|
protected void |
updateChatUser(jadex.bridge.IComponentIdentifier cid,
jadex.bridge.service.types.chat.IChatService cs) |
protected void |
updateRefreshTimer()
Start or stop the refresh timer, if necessary.
|
void |
updateTransfer(jadex.bridge.service.types.chat.TransferInfo fi)
Update the fileinfo in the upload/download area.
|
protected static final javax.swing.UIDefaults icons
protected static final java.util.List<java.lang.String> smileys
public static final java.lang.String lf
public final java.text.DateFormat df
public static final java.lang.String NOTIFICATION_NEW_USER
public static final java.lang.String NOTIFICATION_NEW_MSG
public static final java.lang.String NOTIFICATION_MSG_FAILED
public static final java.lang.String NOTIFICATION_NEW_FILE
public static final java.lang.String NOTIFICATION_FILE_COMPLETE
public static final java.lang.String NOTIFICATION_FILE_ABORT
protected static final java.util.Map<java.lang.String,java.lang.String> NOTIFICATION_SOUNDS
protected javax.swing.JPanel panel
protected javax.swing.JTextPane chatarea
protected javax.swing.JTable usertable
protected ChatPanel.UserTableModel usermodel
protected boolean typing
protected boolean away
protected javax.swing.JTable dtable
protected javax.swing.JTable utable
protected javax.swing.JTabbedPane tpane
protected jadex.commons.future.ISubscriptionIntermediateFuture<jadex.bridge.service.types.chat.ChatEvent> subscription
protected javax.swing.Timer refreshtimer
protected javax.swing.Timer awaytimer
protected jadex.commons.gui.JSplitPanel listpan
protected jadex.commons.gui.JSplitPanel horsplit
protected boolean sound
protected boolean autorefresh
protected java.util.Map<java.lang.String,java.lang.String> notificationsounds
protected javax.swing.JFileChooser filechooser
protected jadex.base.gui.RemoteFileChooser rfilechooser
protected java.util.Map<jadex.bridge.service.types.chat.TransferInfo,javax.swing.JComponent> dialogs
protected int reqcnt
protected javax.swing.Timer icontimer
protected boolean playing
public jadex.commons.future.IFuture<java.lang.Void> init(jadex.base.gui.plugin.IControlCenter jcc, jadex.bridge.service.IService service)
init
in interface jadex.base.gui.componentviewer.IServiceViewerPanel
init
in class jadex.base.gui.componentviewer.AbstractServiceViewerPanel<jadex.bridge.service.types.chat.IChatGuiService>
jcc
- The jcc.service
- The service.protected void updateRefreshTimer()
protected void setAway(boolean away)
protected void updateChatUser(jadex.bridge.IComponentIdentifier cid, jadex.bridge.service.types.chat.IChatService cs)
public javax.swing.JComponent getComponent()
getComponent
in interface jadex.base.gui.componentviewer.IAbstractViewerPanel
getComponent
in class jadex.base.gui.componentviewer.AbstractServiceViewerPanel<jadex.bridge.service.types.chat.IChatGuiService>
public jadex.commons.future.IFuture<java.lang.Void> shutdown()
shutdown
in interface jadex.base.gui.componentviewer.IAbstractViewerPanel
shutdown
in class jadex.base.gui.componentviewer.AbstractServiceViewerPanel<jadex.bridge.service.types.chat.IChatGuiService>
public jadex.commons.future.IFuture<java.lang.Void> tell(java.lang.String text)
text
- The text.public jadex.commons.future.IFuture<java.lang.Void> postStatus()
public void addMessage(jadex.bridge.IComponentIdentifier cid, java.lang.String text, java.lang.String nick, boolean privatemessage, boolean sendfailure)
public void setUserState(jadex.bridge.IComponentIdentifier cid, java.lang.Boolean online, java.lang.Boolean typing, java.lang.Boolean away, java.lang.String nickname, byte[] image)
public jadex.commons.future.IFuture<java.lang.String> acceptFile(jadex.bridge.service.types.chat.TransferInfo ti)
protected void notifyChatEvent(java.lang.String type, jadex.bridge.IComponentIdentifier source, java.lang.Object value, boolean quiet)
protected void playSound(java.lang.String type, boolean verbose)
type
- The notification event.public void updateTransfer(jadex.bridge.service.types.chat.TransferInfo fi)
public static void append(java.awt.Color c, java.lang.String s, javax.swing.JTextPane p)
public static void doAppend(java.awt.Color c, java.lang.String s, javax.swing.JTextPane p)
public java.lang.String getNotificationSound(java.lang.String type)
public jadex.commons.future.IFuture<java.lang.Void> setProperties(jadex.commons.Properties props)
setProperties
in interface jadex.commons.IPropertiesProvider
setProperties
in class jadex.base.gui.componentviewer.AbstractServiceViewerPanel<jadex.bridge.service.types.chat.IChatGuiService>
public jadex.commons.future.IFuture<jadex.commons.Properties> getProperties()
getProperties
in interface jadex.commons.IPropertiesProvider
getProperties
in class jadex.base.gui.componentviewer.AbstractServiceViewerPanel<jadex.bridge.service.types.chat.IChatGuiService>