Hi,

\n

I'm using the JGraphx library and I have in my application a graph and a tree from which i like to add vertexes to the graph by dragging and dropping a treenode into the mxgraphcomponent.

\n

The nodes in the graph are no mxCell. I added a drag and drop behavior to the tree and called setDropTarget with a specific implementation to retrieve information from my objects of the tree.

\n

The problem now is that I cant move around the elements in the mxgraphComponent as it uses my drag and drop thing.

\n

Is it, and if so, how to make the mxgraphComponent a droptarget without destroying the existing dnd bevahior ?

\n

Thanks in advance

asked 08 Dec '11, 23:29

mremersoncod's gravatar image

mremersoncod
211114
accept rate: 12%

I tried to use the DragGestureListener and DragSource as in the example.

\n

but i always get \nException in thread "AWT-EventQueue-1" java.awt.dnd.InvalidDnDOperationException: Drag and drop in progress\n at sun.awt.dnd.SunDragSourceContextPeer.setDragDropInProgress(SunDragSourceContextPeer.java:298)

\n

but I basically just copied the code from EditorPalette.

\n

Is there a flag I forgot to set ?

(08 Dec '11, 23:52) mremersoncod

This normally happens when you call startDrag while Drag and drop is in progress.

link

answered 07 Jan '12, 22:29

Gaudenz's gravatar image

Gaudenz
80.1k1310
accept rate: 39%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×228
×194
×37
×13

Asked: 08 Dec '11, 23:29

Seen: 2,229 times

Last updated: 07 Jan '12, 22:29