Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Arrows/decorations in the middle of a line
Arrows/decorations in the middle of a line [message #208266] Fri, 10 October 2008 12:49 Go to next message
Adam Flinton is currently offline Adam FlintonFriend
Messages: 32
Registered: July 2009
Member
Dear all,

Is it possible to put a shape/decoration in the middle of a line.

We have a suggested notation for a model with a double arrow (kind of
like the christmas tree in the mindmap example (but obviously smaller)
which would need to go into the middle of a line.

Can I set a polyline/polygon figure onto the middle of a connector/line?

e.g. in:

http://wiki.eclipse.org/GMF_Tutorial_Part_2#Graphical_Defini tion_2

"Returning to our graphical definition model (mindmap.gmfgraph), let's
right-click on our gallery and add a 'New Child > Figure Descriptor' and
to it a 'New Child > Polyline Connection'. Name it 'DashedLineOpenArrow'
and change 'Line Kind' to LINE_DASH. Then add a 'New Child > Polyline
Decoration' element to the Figure Gallery and name it 'OpenArrow'. The
default decoration will be an open arrow (while a Polygon Decoration
will be a filled triangle), but if you want to make one explicitly, you
could add three Template Point children to the OpenArrow with X:Y values
of -1:1, 0:0, and -1:-1. Finally, add the OpenArrow as a Target
Decoration to the DashedLineOpenArrow polyline."


All I need to do is to find the middle wrt the X:Y coords & create the
polygon/polyline decoration?

TIA

Adam
Re: Arrows/decorations in the middle of a line [message #208573 is a reply to message #208266] Tue, 14 October 2008 21:29 Go to previous messageGo to next message
Anthony Hunter is currently offline Anthony HunterFriend
Messages: 446
Registered: July 2009
Senior Member
Hi Adam,

You will need to get into the code a little. The GMF PolylineConnection
comes from GEF. The GMF Runtime only supports source and target decorations.
Since GEF supports a ConnectionLocator at the source, target and middle, you
should be able to extend the generated code to move the decoration to the
middle.

Cheers...
Anthony

"AdamF" <adam@softfab.com> wrote in message
news:gcnj11$53c$1@build.eclipse.org...
> Dear all,
>
> Is it possible to put a shape/decoration in the middle of a line.
>
> We have a suggested notation for a model with a double arrow (kind of like
> the christmas tree in the mindmap example (but obviously smaller) which
> would need to go into the middle of a line.
>
> Can I set a polyline/polygon figure onto the middle of a connector/line?
>
> e.g. in:
>
> http://wiki.eclipse.org/GMF_Tutorial_Part_2#Graphical_Defini tion_2
>
> "Returning to our graphical definition model (mindmap.gmfgraph), let's
> right-click on our gallery and add a 'New Child > Figure Descriptor' and
> to it a 'New Child > Polyline Connection'. Name it 'DashedLineOpenArrow'
> and change 'Line Kind' to LINE_DASH. Then add a 'New Child > Polyline
> Decoration' element to the Figure Gallery and name it 'OpenArrow'. The
> default decoration will be an open arrow (while a Polygon Decoration will
> be a filled triangle), but if you want to make one explicitly, you could
> add three Template Point children to the OpenArrow with X:Y values
> of -1:1, 0:0, and -1:-1. Finally, add the OpenArrow as a Target Decoration
> to the DashedLineOpenArrow polyline."
>
>
> All I need to do is to find the middle wrt the X:Y coords & create the
> polygon/polyline decoration?
>
> TIA
>
> Adam
Re: Arrows/decorations in the middle of a line [message #208818 is a reply to message #208573] Thu, 16 October 2008 10:12 Go to previous message
Adam Flinton is currently offline Adam FlintonFriend
Messages: 32
Registered: July 2009
Member
Thanks

Adam

Anthony Hunter wrote:
> Hi Adam,
>
> You will need to get into the code a little. The GMF PolylineConnection
> comes from GEF. The GMF Runtime only supports source and target decorations.
> Since GEF supports a ConnectionLocator at the source, target and middle, you
> should be able to extend the generated code to move the decoration to the
> middle.
>
> Cheers...
> Anthony
>
> "AdamF" <adam@softfab.com> wrote in message
> news:gcnj11$53c$1@build.eclipse.org...
>> Dear all,
>>
>> Is it possible to put a shape/decoration in the middle of a line.
>>
>> We have a suggested notation for a model with a double arrow (kind of like
>> the christmas tree in the mindmap example (but obviously smaller) which
>> would need to go into the middle of a line.
>>
>> Can I set a polyline/polygon figure onto the middle of a connector/line?
>>
>> e.g. in:
>>
>> http://wiki.eclipse.org/GMF_Tutorial_Part_2#Graphical_Defini tion_2
>>
>> "Returning to our graphical definition model (mindmap.gmfgraph), let's
>> right-click on our gallery and add a 'New Child > Figure Descriptor' and
>> to it a 'New Child > Polyline Connection'. Name it 'DashedLineOpenArrow'
>> and change 'Line Kind' to LINE_DASH. Then add a 'New Child > Polyline
>> Decoration' element to the Figure Gallery and name it 'OpenArrow'. The
>> default decoration will be an open arrow (while a Polygon Decoration will
>> be a filled triangle), but if you want to make one explicitly, you could
>> add three Template Point children to the OpenArrow with X:Y values
>> of -1:1, 0:0, and -1:-1. Finally, add the OpenArrow as a Target Decoration
>> to the DashedLineOpenArrow polyline."
>>
>>
>> All I need to do is to find the middle wrt the X:Y coords & create the
>> polygon/polyline decoration?
>>
>> TIA
>>
>> Adam
>
>
Previous Topic:how to add a scrollbar for label
Next Topic:Relationships on Diagram Disappearing
Goto Forum:
  


Current Time: Fri Jan 22 04:43:19 GMT 2021

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

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

Back to the top