Re: Drag and Drop

From: Dave Hallam <davehallam@yahoo.com>
Date: Fri Aug 16 2002 - 04:05:44 EDT

HI,
In reply to my original email about DnD in OpenMap, I've sorted out what I need to do.
For information, in case anyone else wants to do the same thing and doesn't know how:
To implement a custom DnD catcher (eg to handle remote drops etc.), subclass DefaultDnDCatcher (see BeanBoxDnDCatcher as an example).
Create a handler interface that layers have to implement to enable the catcher to identify which layers are interested in particular drops.
Create a DropListenerSupport object with the map bean that's being used and add it and an instance of the catcher to the MapHandler instance ( see com.bbn.openmap.app.OpenMap
  
The DropListenerSupport fires DnD events to the catcher which will maintain a list of layers that would like to receive the drop. When a layer is selected, from the popup menu in the case of BeanBoxDnDCatcher, the appropriate action can be taken.
Just a quick summary, but a simple guide to anyone who wants to use the capability but doesn't know how.
Regards,
Dave
  Dave Hallam <davehallam@yahoo.com> wrote:
Hi,

Just pondering through the DnD capabilities and was wondering where I was going wrong or what I was missing.

My layer extends OMGraphicHandlerLayer as indicated in the DefaultDnDCatcher docs.

In my main application class I'm doing the following:

....

  mapBean.setProjection(proj);
  mapBean.setPreferredSize(new java.awt.Dimension(envWidth, envHeight));
  
  supp = new DropListenerSupport(mapBean);
 
  beanHandler = getMapHandler();
  
  try
  {
   beanHandler.add(propertyHandler);
   beanHandler.add(mapBean);
   beanHandler.add(supp);
   propertyHandler.createComponents(beanHandler);
  }

...

What is it that I have to do to get this to work. What I want to do is to be able to drag files, java objects, etc onto the map and for the layers to decide what they want to do about it.

Many thanks,

Dave

 

Tel: +44 (0) 7092 250 375
Fax: +44 (0) 7092 250 375

---------------------------------
Get a bigger mailbox -- choose a size that fits your needs.

http://uk.docs.yahoo.com/mail_storage.html

Tel: +44 (0) 7092 250 375
Fax: +44 (0) 7092 250 375

---------------------------------
Get a bigger mailbox -- choose a size that fits your needs.

http://uk.docs.yahoo.com/mail_storage.html

--
[To unsubscribe to this list send an email to "majdart@bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Fri Aug 16 04:11:41 2002

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:33 EDT