The ports are visualized, but I have the same problem that I mentioned in my previous post: the rectangles of the ports are at the same position.

So I tried to change the location of the drop, changing:

dropObjectsRequest.setLocation(new Point(x, y));

with no results.

Why when I drop the ports manually from the model viewer they are visualized in the location of the mouse drop?
Isn't this method used in the mouse drop from the user?

Another question: I tried to drop a Connector (between a port of the Component and a port of the Property inside the Component) with the dropObject method, but doesn't work, it throws an exception; DropObjectsRequest doesn't work with Connectors?

The ports are visualized, but I have the same problem that I mentioned in my previous post: the rectangles of the ports are at the same position.

By the way, have you posted a bug so that the locator handles conflicting positions as I suggested ?

123star wrote on Sat, 23 October 2010 13:13

So I tried to change the location of the drop, changing:

dropObjectsRequest.setLocation(new Point(x, y));

with no results.

Why when I drop the ports manually from the model viewer they are visualized in the location of the mouse drop?
Isn't this method used in the mouse drop from the user?

I haven't tried, but I'm pretty sure this is the correct way.
Though, the definition of a location is very often confusing betwen absolute and local locations.
So my bet is that you probably used local coordinates (relative to the target figure) whereas I think absolute coordinates shall be used (relative to the whole diagram).

to try and compare what the locations are in case of a manual drop and in case of a programmatic drop. You may also check that the traslation delta which is then applied later in the method is the same.

123star wrote on Sat, 23 October 2010 13:13

Another question: I tried to drop a Connector (between a port of the Component and a port of the Property inside the Component) with the dropObject method, but doesn't work, it throws an exception; DropObjectsRequest doesn't work with Connectors?

method. So this "should" (meaning if it doesn't, this is an unexpected behavior) work correctly. If it does not and if there is not already a bug on that subject, you may post a new bug with the complete steps to reproduce and the associated stack trace.