Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Connections connected to connections
Connections connected to connections [message #718517] Wed, 24 August 2011 11:19 Go to next message
Robert Brodt is currently offline Robert Brodt
Messages: 592
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

I'm having a heck of time getting a connection connected to another connection. Can someone please post a working example?

Thanks!
Bob
Re: Connections connected to connections [message #719259 is a reply to message #718517] Fri, 26 August 2011 10:00 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1590
Registered: July 2009
Location: Walldorf, Germany
Senior Member
There's a small sample implementation in the Sketch test tool (available in
the Git repository in the tests folder) which at least explains the basic
usages.

HTH,
Michael


"Bob Brodt" <forums-noreply@eclipse.org> wrote in message
news:j33463$gv2$1@news.eclipse.org...
> I'm having a heck of time getting a connection connected to another
> connection. Can someone please post a working example?
>
> Thanks!
> Bob
Re: Connections connected to connections [message #726509 is a reply to message #719259] Sun, 18 September 2011 08:12 Go to previous messageGo to next message
Andreas Graf is currently offline Andreas Graf
Messages: 151
Registered: July 2009
Senior Member
Hi all,

are you referring to AbstractSketchCreateSimpleConnectionFeature.java? To this piece of code:

if (startAnchor == null && (context.getSourcePictogramElement() instanceof Connection)) {

			Shape s = SketchUtil.createConnectionPoint(context.getSourceLocation(), getDiagram());
			startAnchor = cs.createChopboxAnchor(s);

			Connection splitConnection = (Connection) context.getSourcePictogramElement();
			createConnection(splitConnection.getStart(), startAnchor);
			createConnection(startAnchor, splitConnection.getEnd());

			EcoreUtil.delete(splitConnection);
		}



It seems that the "connection to a connection" functionality is actually a "split connection in two" functionality? Is that so? From the above code, I would also assume that e.g. any decorators get lost? What happens if you click on the now split connection? Will only half of it get selected?

Thanks,

Andreas
Re: Connections connected to connections [message #727028 is a reply to message #726509] Tue, 20 September 2011 04:20 Go to previous message
Michael Wenz is currently offline Michael Wenz
Messages: 1590
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Yes, that's right. The coding basically splits the existing connection into
two new ones. Decorators would have to be moved along to the new
connection(s) as it it suitable for the tool. Selecting a part of the split
connection will select only one part.

The functionality offered by Graphiti is intentionally very basic to enable
tool builders to create a bunch of different behaviours when splitting
connections.

Michael
Previous Topic:Does Graphiti support fill patterns?
Next Topic:Transient (run time only) graphics in Graphiti?
Goto Forum:
  


Current Time: Thu Aug 28 21:26:06 EDT 2014

Powered by FUDForum. Page generated in 0.03663 seconds