Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Drawing 2 different connections for same source and target pictograms
Drawing 2 different connections for same source and target pictograms [message #1011858] Wed, 20 February 2013 11:38 Go to next message
Saniya Mirajkar is currently offline Saniya Mirajkar
Messages: 30
Registered: August 2012
Member
I have two rectangular pictograms.I need to connect this two rectangles with two different connectors.

I am using Manhattan connections.
Right now the two different connectors can be drawn but they overlap over each other.So the other one is hidden. And user does not know of the other connection.

How can I define 2 different connection points, so I can draw 2 connectors which are connected to source and target at 2 different points?
Re: Drawing 2 different connections for same source and target pictograms [message #1011870 is a reply to message #1011858] Wed, 20 February 2013 11:56 Go to previous messageGo to next message
Robert Brodt is currently offline Robert Brodt
Messages: 608
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hi Saniya,

I have implemented my own connection router in the Eclipse BPMN2 Modeler which checks for overlapping connections and offsets one of them horizontally and vertically by a few pixels. The result looks like this:

http://content.screencast.com/users/rbrodt/folders/Jing/media/4741e601-9f5e-4ad3-9175-86b09d3f77d6/2013-02-20_0454.png

HTH,
Bob
Re: Drawing 2 different connections for same source and target pictograms [message #1011971 is a reply to message #1011858] Wed, 20 February 2013 16:05 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1603
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Saniya,

you can also define two anchors of type FixPointAnchor or BoxRelativeAnchor,
place them at different locations of your shape and use them as start/end
point for the two connections instead of the default ChoboxAnchor.

Michael
Re: Drawing 2 different connections for same source and target pictograms [message #1012345 is a reply to message #1011971] Thu, 21 February 2013 11:42 Go to previous messageGo to next message
Annika Wießgügel is currently offline Annika Wießgügel
Messages: 11
Registered: January 2013
Junior Member
Is there any, easy, way to be able to place the connection everywhere on the recantangle shape of the class?
Default should be relativ to the center, but i want to be able to rearrange it to any point of the class shape.
Re: Drawing 2 different connections for same source and target pictograms [message #1012380 is a reply to message #1012345] Thu, 21 February 2013 13:05 Go to previous messageGo to next message
Saniya Mirajkar is currently offline Saniya Mirajkar
Messages: 30
Registered: August 2012
Member
Michael,

When do I need to create this Boxrelative/Fixpoint Anchors i.e in the Add feature of pictogram or while creating connection?


I try creating while creating connections but that does not work.

Also how can I add the self connections where source and target are same?

Re: Drawing 2 different connections for same source and target pictograms [message #1012915 is a reply to message #1012345] Fri, 22 February 2013 12:55 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1603
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Annika,

this is possible when you use BoxRelativeAnchors or FixPointAnchors instead
of ChopboxAnchors. Have a look at
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.graphiti.doc%2Fresources%2Fdocu%2Fgfw%2Fanchors.htm&cp=29_1_3_8_1,
that should give you an idea.

Michael
Re: Drawing 2 different connections for same source and target pictograms [message #1012917 is a reply to message #1012380] Fri, 22 February 2013 13:02 Go to previous message
Michael Wenz is currently offline Michael Wenz
Messages: 1603
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Saniya,

classical answer: that depends... ;-)

You can create the anchors in both features you mentioned. Doing it in the
add feature of your shape will basically mean you have a fixed list of
positions you want users to allow the creation of connections to, while
adding them on connection creation will allow an arbitrary number of
connection anchors.

When you want to create them on connection creation you should still have a
chopbox anchor for your shpae users will use to create new connections. In
the create connection feature on create you will get this chopbox anchor
passed within the context. You will then need to create new anchors, set
them in the context and create the connection between these new anchors. I
think the chess example does something similar, at least in respect to
exchanging the anchors to be used on connection creation.

A self connection is basically a normal connection, the difference is that
it simply ends on the same shape or even the same anchor. You should ensure
that you use a connection the user can see, e.g. a freeform connection with
some bendpoints in it. A direct connection would not be usable here, because
it would end up in just one point which may additionally be hidden
underneath the shape.

Michael
Previous Topic:OPTION_SCHEMA_LOCATION has no effect
Next Topic:org.eclipse.graphiti.ui.editor.DiagramEditorInput
Goto Forum:
  


Current Time: Wed Oct 01 14:24:02 GMT 2014

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

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