Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Double lined arrow
Double lined arrow [message #667802] Mon, 02 May 2011 05:51 Go to next message
Phillipp  is currently offline Phillipp
Messages: 24
Registered: May 2011
Junior Member
I played around for some days with graphiti but theres one point I could not figure out by now.
How can I create a connection with two polylines so that I get somethin like ==>. A ConnectionDecorator would just do the job for the arrow-tip but I can't get the double line.
Re: Double lined arrow [message #667817 is a reply to message #667802] Mon, 02 May 2011 06:05 Go to previous messageGo to next message
Tim Kaiser is currently offline Tim Kaiser
Messages: 118
Registered: July 2009
Senior Member
Hi,

connections are always represented as lines.
You can only tweak the style. Otherwise it would
be quite difficult to define a generic behavior (think bendpoints etc).

As a workaround, you might add a second parallel line also as a connection
decorator (like the tip)?

Best, Tim
Re: Double lined arrow [message #668224 is a reply to message #667802] Wed, 04 May 2011 11:19 Go to previous messageGo to next message
Phillipp  is currently offline Phillipp
Messages: 24
Registered: May 2011
Junior Member
Thank you for your answer. I hoped that there would be some other possibility, since I'm trying to build a modelling-tool for which double lines are essential.

But for now I have to live with this workaround. Would be a nice feature though...

EDIT: I'm trying to get the second line as a ConnectionDecorator right now but I can't see where to get the total length of the connection and I need the total length to specify my decorator. Or I am totally confused.

[Updated on: Wed, 04 May 2011 11:38]

Report message to a moderator

Re: Double lined arrow [message #668316 is a reply to message #668224] Thu, 05 May 2011 03:35 Go to previous messageGo to next message
Tim Kaiser is currently offline Tim Kaiser
Messages: 118
Registered: July 2009
Senior Member
You may open a bugzilla with an enhancement request for
enabling complex shapes for representing connections...
Re: Double lined arrow [message #668342 is a reply to message #667802] Thu, 05 May 2011 05:41 Go to previous messageGo to next message
Phillipp  is currently offline Phillipp
Messages: 24
Registered: May 2011
Junior Member
I opened a enhancement request https://bugs.eclipse.org/bugs/show_bug.cgi?id=344819.

Thanks for your support.
Re: Double lined arrow [message #668808 is a reply to message #667802] Sat, 07 May 2011 12:47 Go to previous messageGo to next message
Phillipp  is currently offline Phillipp
Messages: 24
Registered: May 2011
Junior Member
I'm still working on this topic. I tried now to define a custom color schema like this:

#000000
#000000
#FFFFFF
#FFFFFF
#000000
#000000

I can set this style for the connection but it is not shown in the editor.
Do you have any other ideas on how to get this done?
Re: Double lined arrow [message #675451 is a reply to message #668808] Tue, 31 May 2011 10:39 Go to previous messageGo to next message
Tim Kaiser is currently offline Tim Kaiser
Messages: 118
Registered: July 2009
Senior Member
What about using connection decorators?
Did you try this?
Best, Tim
Re: Double lined arrow [message #675989 is a reply to message #675451] Thu, 02 June 2011 05:38 Go to previous messageGo to next message
Phillipp  is currently offline Phillipp
Messages: 24
Registered: May 2011
Junior Member
I tried to create a parallel line to the connection with a offset of 4px but I came across the problem that i could not figure out how to get the X/Y-coordinates of the connection to set the the decorator right.

Is there a way to get the start and end coordinates of the connection?

Because I'm stuck at this since 3 weeks now...
Re: Double lined arrow [message #676736 is a reply to message #675989] Mon, 06 June 2011 07:10 Go to previous messageGo to next message
Tim Kaiser is currently offline Tim Kaiser
Messages: 118
Registered: July 2009
Senior Member
You might have a look at GefService, method
getConnectionPointAt(..)

If you have a Non-ChopBox anchor something like the following should work:

Anchor startAnchor = connection.getStart();
ILocation startLocation =
Graphiti.getLayoutService().getLocationRelativeToDiagram(startAnchor);

Does it help?
Re: Double lined arrow [message #677002 is a reply to message #676736] Tue, 07 June 2011 05:42 Go to previous messageGo to next message
Phillipp  is currently offline Phillipp
Messages: 24
Registered: May 2011
Junior Member
Thank you, I looks quite like a want it.
Although it would be nice to be able to define a offset for the connection, because if I draw the second line with a connection decorator it is not symmetrical.

Re: Double lined arrow [message #677073 is a reply to message #677002] Tue, 07 June 2011 09:24 Go to previous messageGo to next message
Tim Kaiser is currently offline Tim Kaiser
Messages: 118
Registered: July 2009
Senior Member
i am not sure if i understand correctly what you want to achieve,
but maybe using box relative or fix point anchors can solve your problem.

You can place the box relative/fixpoint anchor slightly below the midpoint
of the shape, thereby
getting a symmetric apperance...

(i suppose right now you are using chop box anchors?)

Best, Tim
Re: Double lined arrow [message #677119 is a reply to message #677073] Tue, 07 June 2011 12:01 Go to previous messageGo to next message
Phillipp  is currently offline Phillipp
Messages: 24
Registered: May 2011
Junior Member
The problem is, that I need to represent a connection with a double line.
With your last posting a was able to create a connection with a polyline as a static decorator from one BoxRelativeAnchor to another.
I know it is a ugly solution but it is the only one I can think of right now and that works more or less by now. (Thanks to you!)

I'll give your idea with setting the anchors of a try. Sounds pretty good

But I would really appreciate if a preconfigured lineStyle.Double ships with a future release Wink


EDIT:
I played around with this workaround for a while now but I can not figure out how to update the given length of my decorator line when one of the shapes it is attached to is moved in the editor.
I wrote a layoutFeature but found out that this is just called when the connection is created but not when you move the shapes with the anchor.
Can/should I do this with extending the AbstractMoveShapeFeature?

[Updated on: Tue, 07 June 2011 14:30]

Report message to a moderator

Re: Double lined arrow [message #677383 is a reply to message #677119] Wed, 08 June 2011 07:13 Go to previous messageGo to next message
Christian Brand is currently offline Christian Brand
Messages: 36
Registered: July 2009
Location: Walldorf/Germany
Member
You are absolutely right. An extension of the exising line styles would be great. You can create another dev request for additional ones.

You are also right with the call of the connection update. This has to be done in your shape's move feature.


Christian Brand
SAP AG - Walldorf - Germany
Re: Double lined arrow [message #677679 is a reply to message #667802] Thu, 09 June 2011 02:45 Go to previous messageGo to next message
Phillipp  is currently offline Phillipp
Messages: 24
Registered: May 2011
Junior Member
Thank you.

The enhancement bug is already created.

Until then I have to get this workaround working Wink
Re: Double lined arrow [message #681975 is a reply to message #677679] Fri, 10 June 2011 03:13 Go to previous messageGo to next message
Christian Brand is currently offline Christian Brand
Messages: 36
Registered: July 2009
Location: Walldorf/Germany
Member
What about your update problem when a shape is moved? Is it working so far?

Christian Brand
SAP AG - Walldorf - Germany
Re: Double lined arrow [message #683203 is a reply to message #681975] Mon, 13 June 2011 04:14 Go to previous message
Phillipp  is currently offline Phillipp
Messages: 24
Registered: May 2011
Junior Member
No, unfortunately not.

I will just drop the double lines for now and wait until this can be accomplished with a linestyle because the effort to get this working is too high for a workaround that looks quite ugly.
Previous Topic:auto update feature doesn't check whether an update is needed
Next Topic:Overriding the Add feature
Goto Forum:
  


Current Time: Mon Jul 28 18:31:29 EDT 2014

Powered by FUDForum. Page generated in 0.03413 seconds