Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Any hooks for connection source feedback?
Any hooks for connection source feedback? [message #827608] Fri, 23 March 2012 15:02 Go to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hi all,

I'm currently working on the eclipse BPMN2 Modeler project and I've run across a snag involving connections between two BPMN2 "Pools". Pools represent participants in a process flow and are rendered as large, narrow rectangles. There may be several connections between them representing message exchanges between the participants.

The problem is when creating these connections, Graphiti uses a chopbox anchor which encompasses the entire Pool rectangle. This makes it really difficult for the user to see, where along the edge of the pool, the connection was originally started (see below).

http://content.screencast.com/users/rbrodt/folders/Jing/media/e2a0d3b4-5511-43ee-9cb7-6ff51bcf69cd/ugly-connection-feedback.png

Here the connection was started from a point on the edge of the bottom Pool, directly below the mouse cursor. What I really want is to dynamically set the source feedback anchor point to be at a point on the edge of the Pool rectangle nearest the mouse cursor, something like this:

http://content.screencast.com/users/rbrodt/folders/Jing/media/8fe75a5b-c109-4c60-add1-5dddfe845ed5/nice-connection-feedback.png

The only way I've been able to do this is to create a small invisible rectangle that is a child of the Pool rectangle, and then change its location in getChopboxAnchorArea() in my ToolBehaviorProvider class. Unfortunately, this requires a command stack transaction which, if the connection is cancelled, leaves a "do nothing" transaction on the stack.

Is there any other way of handling this?

Thanks!
Bob

[Updated on: Fri, 23 March 2012 15:08]

Report message to a moderator

Re: Any hooks for connection source feedback? [message #829624 is a reply to message #827608] Mon, 26 March 2012 15:06 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Hm, that’s difficult: ChopboxAnchors always behave like this and without
really modifying the pictograms model I don’t see a way to do that.

What you might try is use a bunch of BoxRelative or FixpointAnchors around
the borders of your Pool shape. The user would then draw the connection from
one of those instead of the ChopboxAnchor. But that is much overhead and
might still not be what you would like to have…

If you are using Graphiti 0.9.0 (well, one of the milestones towards it) you
can try to omit the dirty flag in the editor by calling
“getDiagramEditor().getEditingDomain().getCommandStack().undo();” from
within the overridden canceledAttaching in your create feature for the
connection.

Michael
Re: Any hooks for connection source feedback? [message #830388 is a reply to message #829624] Tue, 27 March 2012 15:07 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Thanks Michael for the reply. I'm afraid neither of those will work because we're committed to providing helios support Sad

Other than the canceledAttaching() in 0.9.0 is there another way to detect if a connection has been canceled?
Re: Any hooks for connection source feedback? [message #834734 is a reply to message #830388] Mon, 02 April 2012 10:27 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Only the GEF commands Graphiti uses (CreateConnectionCommand) get notified
about that, but they are not public API.

So, sorry. I'm afraid the answer is no.

Michael
Previous Topic:Property sheet with table
Next Topic:Preference page preview
Goto Forum:
  


Current Time: Fri Apr 19 21:15:52 GMT 2024

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

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

Back to the top