Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Moving Bendpoints
Moving Bendpoints [message #659245] Fri, 11 March 2011 16:11 Go to next message
Rhett Hudson is currently offline Rhett HudsonFriend
Messages: 43
Registered: September 2010
Member
After getting my copy and paste feature to work, I discovered that I had no good mechanism for moving FreeformConnections that had bendpoints. My search of the framework for support led me to the PeService's moveBendpoints() method. A little more searching and I discovered that the only place I could plug that in was in the preExecute or postExecute methods of the ToolBehaviorProvider.

That all seems reasonable, but I think there may be a bug in the way that the implementation in PeServiceImpl finds its set of candidate anchors. It calls another method of the service called getOutgoingConnections which packages the corresponding connections of the immediate child anchors of the passed AnchorContainer into a list. The anchors in my diagram are not direct children of the top level container, so they get missed by this process.

Over in the patterns plugin, there's a similar method called moveAllBendpoints(), that performs a recursive search for anchors using a private method called getAnchors(). If the PeService used the recursive search that moveAllBendpoints() uses, it would find my anchors and possibly move my connections.

Am I on the right track here? Should I log that as a bug? Or are there reasons that the search is flat? I can certainly implement my own moveBendpoints() method that performs the search the way I need it done.
Re: Moving Bendpoints [message #659260 is a reply to message #659245] Fri, 11 March 2011 17:09 Go to previous messageGo to next message
Rhett Hudson is currently offline Rhett HudsonFriend
Messages: 43
Registered: September 2010
Member
Having tried it now, I can see that preExcecute and postExecute are not inside the write transaction. So, now I'm not sure where it's possible to call moveBendpoints(). Those methods are the only places in the public interface that I can find where I have an IExecutionInfo to work with.
Re: Moving Bendpoints [message #659472 is a reply to message #659245] Mon, 14 March 2011 08:31 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Did you already have a look into the DefaultMoveBendpointFeature, which is
the hooh Graphiti offers for moving bendpoints? Could that be an alternative
to solve your issue?

Michael


"Rhett Hudson" wrote in message news:ildh73$324$1@news.eclipse.org...

After getting my copy and paste feature to work, I discovered that I had no
good mechanism for moving FreeformConnections that had bendpoints. My search
of the framework for support led me to the PeService's moveBendpoints()
method. A little more searching and I discovered that the only place I could
plug that in was in the preExecute or postExecute methods of the
ToolBehaviorProvider.

That all seems reasonable, but I think there may be a bug in the way that
the implementation in PeServiceImpl finds its set of candidate anchors. It
calls another method of the service called getOutgoingConnections which
packages the corresponding connections of the immediate child anchors of the
passed AnchorContainer into a list. The anchors in my diagram are not direct
children of the top level container, so they get missed by this process.

Over in the patterns plugin, there's a similar method called
moveAllBendpoints(), that performs a recursive search for anchors using a
private method called getAnchors(). If the PeService used the recursive
search that moveAllBendpoints() uses, it would find my anchors and possibly
move my connections.

Am I on the right track here? Should I log that as a bug? Or are there
reasons that the search is flat? I can certainly implement my own
moveBendpoints() method that performs the search the way I need it done.
Re: Moving Bendpoints [message #659595 is a reply to message #659245] Mon, 14 March 2011 18:10 Go to previous messageGo to next message
Rhett Hudson is currently offline Rhett HudsonFriend
Messages: 43
Registered: September 2010
Member
I instrumented a MoveBendpointFeature to understand how it works and in what context it is called. It does not seem to be called if a connection is selected along with group of nodes and then the group is dragged. This results in the nodes all getting move messages, but I don't see any activity in a move bendpoint feature.

I thought perhaps you might be suggesting using MoveBendpointFeatures instead of PeService's moveBendpoints()'s direct model manipulation, but an IFeatureAndContext interface does not have an interface for adding things to the execution list. I tried casting my way down into the implementation classes and adding my move bendpoint feature and contexts directly to the list that way, but it appears that the set of commands to execute has already been established prior to preExecute() and any additions I make to the list are just ignored.

The individual MoveShapeFeatures don't have information about the other selected shapes, so its difficult to move bendpoints inside that feature without moving them once for each anchor. I guess I could move them halfway in each, but that seems a little kludgey.

I think the author of the PeService's moveBendpoints() was trying to provide the service I want. It looks like it wants to be instantiated in a context that has enough information to do the job. Other than the limited search it does for anchors, it would perform the operation I'd like. I'm just not sure how it could be called.

Maybe what we need is a IMoveConnectionFeature that gets invoked when nodes and connections are selected and the nodes get dragged.
Re: Moving Bendpoints [message #660401 is a reply to message #659595] Fri, 18 March 2011 10:22 Go to previous messageGo to next message
Christian Brand is currently offline Christian BrandFriend
Messages: 36
Registered: July 2009
Location: Walldorf/Germany
Member
We do still not get your problem completely. You are selecting some shapes and move them. In this case the bendpoints should move with them. Are you seleting the connections too? Could you please provide a screenshot (or cast) to give us a complete idea of the problem?

Christian Brand
SAP AG - Walldorf - Germany
Re: Moving Bendpoints [message #660491 is a reply to message #660401] Fri, 18 March 2011 15:59 Go to previous messageGo to next message
Rhett Hudson is currently offline Rhett HudsonFriend
Messages: 43
Registered: September 2010
Member
Christian,

I am selecting some shapes using a marquee drag of the selection tool. I have tried both selecting the connections and leaving them unselected. In neither case have I seen the bendpoints move when I drag one of the shapes. Since you expect them to move, it seems likely that my diagram is structured atypically. Maybe if you could refer me to the code that you expect to be moving the bendpoints, I could figure out why it isn't working my diagram.

I don't have permission to attach a file, so I can't post a screen shot. But, it's not a complex picture. Just two rectangular shapes with connection ports on their sides and a freeform connection between them. Then connection has a couple of bendpoints in it to make it non-straight. I drag a marquee around the shapes to select them, add the connection to the selected set by CTRL-clicking it, and then drag one of the shapes. The shapes move, the points of the connection that are attached to the shape's anchors move, but the bendpoints in the middle of the connection remain behind.

--Rhett
Re: Moving Bendpoints [message #661355 is a reply to message #660491] Thu, 24 March 2011 11:03 Go to previous messageGo to next message
Christian Brand is currently offline Christian BrandFriend
Messages: 36
Registered: July 2009
Location: Walldorf/Germany
Member
Could you please open a bugzilla for this?
We should find someone who cares for it.


Christian Brand
SAP AG - Walldorf - Germany
Re: Moving Bendpoints [message #661893 is a reply to message #661355] Mon, 28 March 2011 13:14 Go to previous messageGo to next message
Rhett Hudson is currently offline Rhett HudsonFriend
Messages: 43
Registered: September 2010
Member
Done. It is Bug 341098.
Re: Moving Bendpoints [message #760829 is a reply to message #661893] Mon, 05 December 2011 11:56 Go to previous message
Karthikeyan Missing name is currently offline Karthikeyan Missing nameFriend
Messages: 47
Registered: July 2011
Member
Hi,
Me too having the same problem in GEF. Connected two shapes with bendPoint connection, while moving source shape or target shape, the connection starts moving except the bendPoints. ie myself using absolute Bendpoint while opening the editor because figure bounds is always 0 while opening the editor, if user does any action then I have handled it with relative bend point. I hope now you have understood my problem. If you know any solution or suggession, kindly reply me.

Thanks & Regards,
Karthikeyan.B

[Updated on: Tue, 03 January 2012 07:22]

Report message to a moderator

Previous Topic:Ellipsis shown in Text when using BoxRelativeAnchor
Next Topic:Zoom In / Zoom Out Actions
Goto Forum:
  


Current Time: Fri Apr 19 11:47:57 GMT 2024

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

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

Back to the top