Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Need suggestion on programatically creating connection with diamond shape in between(Connection with diamond shape in between (suggestion/alternate solution))
Need suggestion on programatically creating connection with diamond shape in between [message #996707] Wed, 02 January 2013 18:17 Go to next message
Neeraj Bhusare is currently offline Neeraj Bhusare
Messages: 93
Registered: July 2009
Location: India
Member
Hi,
I have programatically created a connection with diamond shape in between (image below). I have tired two approaches. The second one described below works, however I am not sure if it is correct. I would like to know if there is a better way to do it.

Initially, I tried creating the above in the feature that creates the connection (first connection from source object to the fixed_left_anchor on the diamond and second connection from the fixed_right_anchor to the object on the right), however I realized that I could only return a single connection object from the add() method, and I had created two connections. I looked at the "CompositeConnection" and I guess it won't work in my case.

As an alternative, I wrote a separate feature that creates the diamond shape and the connections (objectA->DiamonShape->objectB, here -> represents a connection from/to objectX to the fixed anchor on the diamond shape). However, I am not very confident with this approach. There are couple of issues like - connection delete only deletes the selected connection and not the whole (connections + diamond shape). Selection doesn't work as expected.

Couldn't find much help in the following threads,

http://www.eclipse.org/forums/index.php/t/391822/

http://www.eclipse.org/forums/index.php/t/392657/

index.php/fa/12867/0/


Thanks in advance.


Best regards, Neeraj
Re: Need suggestion on programatically creating connection with diamond shape in between [message #996884 is a reply to message #996707] Thu, 03 January 2013 05:32 Go to previous messageGo to next message
Neeraj Bhusare is currently offline Neeraj Bhusare
Messages: 93
Registered: July 2009
Location: India
Member
Any thoughts ?

Best regards, Neeraj
Re: Need suggestion on programatically creating connection with diamond shape in between [message #997201 is a reply to message #996707] Fri, 04 January 2013 12:49 Go to previous message
Michael Wenz is currently offline Michael Wenz
Messages: 1592
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Hi,

your approach appears to be valid, but as you already noticed it will need
much more adaptations of the Graphiti default behavior, e.g. you need to
adapt the default delete feature so that it deletes both connections and the
diamond shape when the user deletes one part of the connection.

Do you need the free movability of the diamond shape? In case not you may
also try to use a connection decorator that draws a diamond in the middle of
the connection. With that users will not be able to move the diamond to
another location on the connection or bend the connection by moving the
diamond, but it will mean much less effort for you. There's an example on
connection decorators in the tutorial (displaying the arrows on reference
connections).

Michael
Previous Topic:Anchor creation breaks Graphiti
Next Topic:CompoundDirectedGraph doesn't support horizontal layout
Goto Forum:
  


Current Time: Mon Sep 15 02:09:40 GMT 2014

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

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