|
|
|
|
@ -21,7 +21,7 @@
|
|
|
|
|
/**
|
|
|
|
|
* The <tt>ChatContact</tt> is a wrapping class for the <tt>Contact</tt> and
|
|
|
|
|
* <tt>ChatRoomMember</tt> interface.
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @author Yana Stamcheva
|
|
|
|
|
*/
|
|
|
|
|
public class ChatContact
|
|
|
|
|
@ -49,7 +49,7 @@ public class ChatContact
|
|
|
|
|
/**
|
|
|
|
|
* Creates an instance of <tt>ChatContact</tt> by passing to it the
|
|
|
|
|
* <tt>Contact</tt> for which it is created.
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @param contact the <tt>Contact</tt> for which this <tt>ChatContact</tt>
|
|
|
|
|
* is created
|
|
|
|
|
*/
|
|
|
|
|
@ -57,11 +57,11 @@ public ChatContact(Contact contact)
|
|
|
|
|
{
|
|
|
|
|
this(null, contact);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Creates an instance of <tt>ChatContact</tt> by passing to it the
|
|
|
|
|
* corresponding <tt>MetaContact</tt> and <tt>Contact</tt>.
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @param metaContact the <tt>MetaContact</tt> encapsulating the given
|
|
|
|
|
* <tt>Contact</tt>
|
|
|
|
|
* @param contact the <tt>Contact</tt> for which this <tt>ChatContact</tt>
|
|
|
|
|
@ -82,11 +82,11 @@ public ChatContact(MetaContact metaContact, Contact contact)
|
|
|
|
|
if (name == null || name.length() < 1)
|
|
|
|
|
name = Messages.getI18NString("unknown").getText();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Creates an instance of <tt>ChatContact</tt> by passing to it the
|
|
|
|
|
* <tt>ChatRoomMember</tt> for which it is created.
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @param chatRoomMember the <tt>ChatRoomMember</tt> for which this
|
|
|
|
|
* <tt>ChatContact</tt> is created.
|
|
|
|
|
*/
|
|
|
|
|
@ -104,7 +104,7 @@ public ChatContact(ChatRoomMember chatRoomMember)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the contact identifier.
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @return the contact identifier
|
|
|
|
|
*/
|
|
|
|
|
public String getAddress()
|
|
|
|
|
@ -114,18 +114,18 @@ public String getAddress()
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the contact name.
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @return the contact name
|
|
|
|
|
*/
|
|
|
|
|
*/
|
|
|
|
|
public String getName()
|
|
|
|
|
{
|
|
|
|
|
return name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the current presence status for single user chat contacts and
|
|
|
|
|
* null for multi user chat contacts.
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @return the current presence status for single user chat contacts and
|
|
|
|
|
* null for multi user chat contacts
|
|
|
|
|
*/
|
|
|
|
|
@ -145,29 +145,29 @@ public ImageIcon getStatusIcon()
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the <tt>ProtocolProviderService</tt> of the contact.
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @return the <tt>ProtocolProviderService</tt> of the contact
|
|
|
|
|
*/
|
|
|
|
|
public ProtocolProviderService getProtocolProvider()
|
|
|
|
|
{
|
|
|
|
|
return protocolProvider;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the source contact. It could be an instance of <tt>Contact</tt>
|
|
|
|
|
* or <tt>ChatRoomMember</tt> interface.
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @return the source contact
|
|
|
|
|
*/
|
|
|
|
|
public Object getSourceContact()
|
|
|
|
|
{
|
|
|
|
|
return sourceContact;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the avatar image corresponding to the source contact. In the case
|
|
|
|
|
* of multi user chat contact returns null.
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @return the avatar image corresponding to the source contact. In the case
|
|
|
|
|
* of multi user chat contact returns null
|
|
|
|
|
*/
|
|
|
|
|
@ -202,6 +202,9 @@ else if(contact != null)
|
|
|
|
|
if(contactImage != null)
|
|
|
|
|
{
|
|
|
|
|
Image image = ImageLoader.getBytesInImage(contactImage);
|
|
|
|
|
if(image == null)
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
return ImageUtils.scaleIconWithinBounds(
|
|
|
|
|
new ImageIcon(image),
|
|
|
|
|
AVATAR_ICON_WIDTH,
|
|
|
|
|
@ -211,7 +214,7 @@ else if(contact != null)
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns <code>true</code> if this is the currently selected contact in
|
|
|
|
|
* the list of contacts for the chat, otherwise returns <code>false</code>.
|
|
|
|
|
@ -225,7 +228,7 @@ public boolean isSelected()
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets this isSelected property of this chat contact.
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @param isSelected <code>true</code> to indicate that this contact would
|
|
|
|
|
* be the selected contact in the list of chat window contacts, otherwise -
|
|
|
|
|
* <code>false</code>
|
|
|
|
|
|