diff --git a/src/net/java/sip/communicator/impl/gui/utils/ContactListDraggable.java b/src/net/java/sip/communicator/impl/gui/utils/ContactListDraggable.java new file mode 100644 index 000000000..9c975b7ea --- /dev/null +++ b/src/net/java/sip/communicator/impl/gui/utils/ContactListDraggable.java @@ -0,0 +1,131 @@ +/* + * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ + +package net.java.sip.communicator.impl.gui.utils; + +import java.awt.*; + +import net.java.sip.communicator.service.protocol.*; +import net.java.sip.communicator.service.contactlist.*; + +/** + * ContactListDraggable is a representation of an element + * currently dragged over the contact list. + */ +public class ContactListDraggable +{ + /** + * Source MetaContact in the current move. + */ + private MetaContact metaContact; + + /** + * The spefic Contact moved from the MetaContact, if any. + * null otherwise + */ + private Contact contact; + + /** + * A visual Component related to the Contact or + * MetaContact which we are moving. + */ + private Component component; + + /** + * Location of the image representing this ContactListDraggable + */ + private Point location; + + /** + * Image used to give a visual feedback of the DnD operation. + */ + private Image image; + + /** + * Creates a new instance of ContactListDraggable + */ + public ContactListDraggable(MetaContact metaContact, Contact contact, + Component component) + { + setMetaContact(metaContact); + setContact(contact); + setComponent(component); + } + + /** + * Obtain the MetaContact associated with this + * ContactListDraggable + * + * @return metacontact + */ + public MetaContact getMetaContact() + { + return metaContact; + } + + private void setMetaContact(MetaContact metaContact) + { + this.metaContact = metaContact; + } + + /** + * Obtain the Contact associated with this + * ContactListDraggable + * + * @return contact + */ + public Contact getContact() { + return contact; + } + + private void setContact(Contact contact) + { + this.contact = contact; + } + + /** + * Obtain the Component associated with this + * ContactListDraggable + * + * @return component + */ + public Component getComponent() + { + return component; + } + + private void setComponent(Component component) { + this.component = component; + } + + /** + * @return location + */ + public Point getLocation() + { + return location; + } + + public void setLocation(Point p) + { + location = p; + } + + /** + * @return image + */ + public Image getImage() + { + return image; + } + + public void setImage(Image image) + { + this.image = image; + } +} +