Skip to main content



      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] Thu, 17 October 2019 23:41 Go to next message
Eclipse UserFriend
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 00:14] by Moderator

Re: Displaying the label/text in canvas for polyline figure [message #1816049 is a reply to message #1816047] Fri, 18 October 2019 00:35 Go to previous messageGo to next message
Eclipse UserFriend
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 00:17 Go to previous messageGo to next message
Eclipse UserFriend
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 00:33] by Moderator

Re: Displaying the label/text in canvas for polyline figure [message #1816358 is a reply to message #1816090] Mon, 28 October 2019 07:37 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
I was able to find a solution to the problem.

Thank you

[Updated on: Mon, 28 October 2019 07:37] by Moderator

Re: Displaying the label/text in canvas for polyline figure [message #1819251 is a reply to message #1816358] Fri, 10 January 2020 09:05 Go to previous message
Eclipse UserFriend
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 18 13:42:16 EDT 2025

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

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

Back to the top