[OpenMap Users] Drag-N-Drop in OM 4.6

From: Chris Hopkins <chopkins_at_cra.com>
Date: Mon, 28 Jun 2004 12:43:03 -0400

Hi all -

I'm currently using OpenMap 4.6 and trying to work with drag-n-drop. I have
extended the DefaultDnDCatcher class (and replaced the dnd catcher in the
opernmap.properties file with my own) and can now dispatch the drop the my
layers using my homegrown mechanism. However, I've noticed that I am not
getting the call to drop(...) when I try to modify the drag action using the
Control key (for copying instead of moving).

I have overridden the setLayers method of DefaultDnDCatcher like so:

  public void setLayers(Layer[] allLayers) {
      DropTarget dropTarget;
      // remove old layers list
      for (int i = 0; i < allLayers.length; i++) {
          // create a new drop target
          dropTarget = new DropTarget(allLayers[i],
DnDConstants.ACTION_COPY_OR_MOVE, this, true);
          if (allLayers[i] instanceof OMGraphicHandlerLayer) {
              // keep a reference to potential drop target
              layers.put(allLayers[i].getName(), allLayers[i]);

so I can create a drop target that supports both copy and move. The
DefaultDnDCatcher only suppoer ACTION_MOVE. However, I'm still not receiving
a drop notification when I have the Control key pressed.

I have noticed that with the default application, when I hit the Control
key, the cursor changes to a circle with a line through it indicating that
the drop is not valid. I have looked at the construction of the drop target
and drag source and I cannot figure out why the Control modifier is not
registering the drop. Has anyone ran into this and figure a way around it. I
really need to be able to get both move and copy drop events.


[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Mon Jun 28 2004 - 12:59:48 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:05 EDT