Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Moving Shape over Connection
Moving Shape over Connection [message #1023884] Mon, 25 March 2013 11:31 Go to next message
Dan Simkins is currently offline Dan Simkins
Messages: 38
Registered: December 2012
Member
Hi,

If I drag a shape normally on the canvas, all is well and the shape snaps to grid. If however I drag a shape over a connection such that the mouse cursor is over the connection, the connection is highlighted, the shape is no longer snapped to grid and on release, the shape is drawn offset from the drag drop position.

I have examined the MoveFeature and it appears that targetConnection is set when the cursor is over the connection. In addition, the deltaX and Y have been adjusted.

Ideally I would like to to achieve the following:

1) when the shape is dragged over a connection, do not highlight the connection and the shape remains snapped to grid; and
2) the moved position of the shape should be on-grid at the dropped position and not offset.

Is it possible to disable the selection of the connection when dragging a shape over a connection and if so, would that solve the shape position being offset?

Many thanks,

Dan
Re: Moving Shape over Connection [message #1027015 is a reply to message #1023884] Tue, 26 March 2013 13:08 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1595
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Dan,

the tool beahvior provider offers a hook isConnectionSelectionEnabled() that
prevents connection selection when false is returned. You might try to use
the canMoveShape and moveShape methods for setting/releasing a state flag
that indicates if connection selection shall be allowed or not. I haven't
tried that though and I'm not sure if it will work.

The offset issue below might be something else. If the above does not help
please open a Bugzilla for this issue.

Michael
Re: Moving Shape over Connection [message #1028426 is a reply to message #1027015] Thu, 28 March 2013 08:39 Go to previous messageGo to next message
Dan Simkins is currently offline Dan Simkins
Messages: 38
Registered: December 2012
Member
Hi Michael,

Thanks for your response.

I have checked out the "isConnectionSelectionEnabled" however this seems to apply only to selection and not highlighting on drag/move.

I shall do some more investigation and report back.

Kind regards

Dan
Re: Moving Shape over Connection [message #1041687 is a reply to message #1028426] Mon, 15 April 2013 12:20 Go to previous message
Dan Simkins is currently offline Dan Simkins
Messages: 38
Registered: December 2012
Member
Hi Michael,

I have raised a new bug (https://bugs.eclipse.org/bugs/show_bug.cgi?id=405717) for this issue.

Kind regards

Dan

[Updated on: Mon, 15 April 2013 12:21]

Report message to a moderator

Previous Topic:Loss of redo
Next Topic:Zooming in and out
Goto Forum:
  


Current Time: Thu Sep 18 09:48:50 GMT 2014

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

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