Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 Tools » Drag'n drop classes or associations onto class diagram
Drag'n drop classes or associations onto class diagram [message #623710] Fri, 08 May 2009 23:29
Jens von Pilgrim is currently offline Jens von PilgrimFriend
Messages: 304
Registered: July 2009
Senior Member
Hi all,

I'm currently working on a slightly modified version of the UML diagram
editors. In my project, I want to add drag and drop support to the
editor. Since it is not working as expected, I'm wondering if drag and
drop is implemented in the 0.8.0 version of the UML diagram editor.
Actually I've found no way to drag and drop anything from outside the
diagram, e.g. from an EMF UML tree editor, into the diagram (in the
original 0.8.0 class diagram editor).

To be a more specific about my problem (just in case someone could give
me a hint): I want to drag and drop sub-models, e.g. a set of classes
with associations, from one diagram to another (with moving or copying
the elements, more or less...)---my tweaked editor is able to display
multiple diagrams in a single viewer. I assume I have to implement
something similar to
DiagramDragDropEditPolicy.createViewsAndArrangeCommand(..). So I have
created my own command(s) in a similar fashion, and it works for
classes etc., that is for Nodes. But it isn't working for associations,
i.e. Edges. The problem is, that no command is created for refreshing
the connections and they cannot be created like nodes. From the
DiagramDragDropEditPolicy I've copied the snippet to create the refresh

RefreshConnectionsRequest refreshRequest = new
Command refreshCommand = getHost().getCommand(refreshRequest);

getHost() returns the edit part of the target diagram. But
refreshCommand is null. Since I haven't figured out how to use drag and
drop (from outside a diagram into a diagram) in the original UML tools
editor, I'm wondering whether there is any provider available creating
such a command (or policy which creates the command).

Actually I have tried to only create the elements. In this case, the
diagram is somehow automatically updated (the nodes are created at a
default location), but the associations are not displayed neither.


Previous Topic:Drag'n drop classes or associations onto class diagram
Next Topic:Bugs and features
Goto Forum:

Current Time: Tue Mar 28 10:15:44 GMT 2017

Powered by FUDForum. Page generated in 0.03620 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software