Package jadex.tools.chat
Class ChatUser
- java.lang.Object
- 
- jadex.tools.chat.ChatUser
 
- 
 public class ChatUser extends java.lang.ObjectStruct to hold the user state in the chat GUI.
- 
- 
Field SummaryFields Modifier and Type Field Description protected javax.swing.IconavatarThe avatar image.protected booleanawayThe away flag.protected IComponentIdentifiercidThe chat user.protected static javax.swing.UIDefaultsiconsThe icons.protected longlastupdateThe time of the last update for checking when user becomes offline.protected java.util.Set<java.lang.Integer>messagesThe open message ids.protected java.lang.StringnickThe cached nickname.protected booleantypingThe typing flag.
 - 
Constructor SummaryConstructors Constructor Description ChatUser(IComponentIdentifier cid)Create a new chat user object.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMessage(int id)Add a message that is currently being sent.IComponentIdentifiergetComponentIdentifier()Get the cid.javax.swing.IcongetIcon()Get an icon for the user.java.lang.StringgetNick()Get the nick.booleanisAvatarUnknown()Test if image is unknown.booleanisAway()Get the away state.booleanisNickUnknown()Test if nickname is unknown.booleanisTyping()Get the typing state.voidremoveMessage(int id)Remove a message when sending is finished.voidsetAvatar(javax.swing.Icon avatar)Set the image.voidsetAway(boolean away)Set the away state.voidsetNick(java.lang.String nick)Set the nick.booleansetOnline(java.lang.Boolean online)Called when the user has been detected offline or onlinevoidsetTyping(boolean typing)Set the typing state.
 
- 
- 
- 
Field Detail- 
iconsprotected static final javax.swing.UIDefaults icons The icons.
 - 
cidprotected IComponentIdentifier cid The chat user.
 - 
typingprotected boolean typing The typing flag.
 - 
awayprotected boolean away The away flag.
 - 
messagesprotected java.util.Set<java.lang.Integer> messages The open message ids.
 - 
nickprotected java.lang.String nick The cached nickname.
 - 
avatarprotected javax.swing.Icon avatar The avatar image.
 - 
lastupdateprotected long lastupdate The time of the last update for checking when user becomes offline.
 
- 
 - 
Constructor Detail- 
ChatUserpublic ChatUser(IComponentIdentifier cid) Create a new chat user object.
 
- 
 - 
Method Detail- 
getIconpublic javax.swing.Icon getIcon() Get an icon for the user.
 - 
setTypingpublic void setTyping(boolean typing) Set the typing state.
 - 
isTypingpublic boolean isTyping() Get the typing state.
 - 
setAwaypublic void setAway(boolean away) Set the away state.
 - 
isAwaypublic boolean isAway() Get the away state.
 - 
getNickpublic java.lang.String getNick() Get the nick.- Returns:
- the nick.
 
 - 
setNickpublic void setNick(java.lang.String nick) Set the nick.- Parameters:
- nick- The nick to set.
 
 - 
isNickUnknownpublic boolean isNickUnknown() Test if nickname is unknown.
 - 
isAvatarUnknownpublic boolean isAvatarUnknown() Test if image is unknown.
 - 
setAvatarpublic void setAvatar(javax.swing.Icon avatar) Set the image.- Parameters:
- image- The image to set.
 
 - 
getComponentIdentifierpublic IComponentIdentifier getComponentIdentifier() Get the cid.- Returns:
- the cid.
 
 - 
addMessagepublic void addMessage(int id) Add a message that is currently being sent.
 - 
removeMessagepublic void removeMessage(int id) Remove a message when sending is finished.
 - 
setOnlinepublic boolean setOnline(java.lang.Boolean online) Called when the user has been detected offline or online- Returns:
- True, when to much offline detections appeared and the user should be removed.
 
 
- 
 
-