Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Displaying the label/text in canvas for polyline figure(how to draw a text for polyline figure in an canvas.)
Displaying the label/text in canvas for polyline figure [message #1816047] Fri, 18 October 2019 03:41 Go to next message
Naveen R is currently offline Naveen RFriend
Messages: 7
Registered: May 2019
Junior Member
Hi,

We have a straight line i.e a polyline figure having a property name that needs to be displayed in the canvas as a label or text next to it.

[Updated on: Fri, 18 October 2019 04:14]

Report message to a moderator

Re: Displaying the label/text in canvas for polyline figure [message #1816049 is a reply to message #1816047] Fri, 18 October 2019 04:35 Go to previous messageGo to next message
Matthias Wienand is currently offline Matthias WienandFriend
Messages: 230
Registered: March 2015
Senior Member
Hi Naveen,

the general approach is to have a controller (ContentPart or EditPart for GEF-Legacy) that displays the label. You can have a look at how Zest.FX handles this for GEF, or how GMF handles this for GEF-Legacy.

Best regards,
Matthias
Re: Displaying the label/text in canvas for polyline figure [message #1816090 is a reply to message #1816049] Mon, 21 October 2019 04:17 Go to previous messageGo to next message
Naveen R is currently offline Naveen RFriend
Messages: 7
Registered: May 2019
Junior Member
Hi Matthias,

To Display labels for polyline in canvas, the following steps were followed.

1. Created the label and added as a child figure to the polyline figure.
2. The polyline figure layout is set to XYLayout.
3. In the editing part for the label, the layout constraint is set.
4. Now the label is displayed for the polyline figure on the canvas.

But the problem is the label is not properly displayed if the polyline figure is at a specific angle of 180 degrees and 90 degrees as shown in the below image.

index.php/fa/36621/0/

index.php/fa/36622/0/

For another angle, the label works perfectly fine as shown below in the image.

index.php/fa/36623/0/





[Updated on: Thu, 24 October 2019 04:33]

Report message to a moderator

Re: Displaying the label/text in canvas for polyline figure [message #1816358 is a reply to message #1816090] Mon, 28 October 2019 11:37 Go to previous messageGo to next message
Naveen R is currently offline Naveen RFriend
Messages: 7
Registered: May 2019
Junior Member
Hi,
I was able to find a solution to the problem.

Thank you

[Updated on: Mon, 28 October 2019 11:37]

Report message to a moderator

Re: Displaying the label/text in canvas for polyline figure [message #1819251 is a reply to message #1816358] Fri, 10 January 2020 14:05 Go to previous message
Matthias Wienand is currently offline Matthias WienandFriend
Messages: 230
Registered: March 2015
Senior Member
That problem seems to be interesting. Would you mind sharing some insights?

Best regards,
Matthias
Previous Topic:GEF 5.1.0 compatibilty with gtk3
Next Topic:Looking for simple example
Goto Forum:
  


Current Time: Fri Apr 26 03:59:41 GMT 2024

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

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

Back to the top