Skip to main content



      Home
Home » Eclipse Projects » GEF » No labels after using IFigureProvider(My labels are not displayed anymore after using a custom Figure)
No labels after using IFigureProvider [message #786108] Sun, 29 January 2012 20:46 Go to next message
Eclipse UserFriend
I implemented IFigureProvider in my LabelProvider and I return the Ellipse() figure for my nodes. The custom figure displays perfectly but my labels (returned by getText(...)) do not show up anymore for my nodes (they do show up for my connections).
Is there a way to get my labels to show up again?
Re: No labels after using IFigureProvider [message #786651 is a reply to message #786108] Mon, 30 January 2012 12:15 Go to previous message
Eclipse UserFriend
I figured out that the IFigure has to draw the label itself. So in my IFigure getFigure(Object element) method I now create a custom Figure derived from Ellipse that adds a label to itself. It uses a StackLayout to have the label on top of the ellipse. Something like this (constructor of custom Figure):

super();
this.setForegroundColor(ColorConstants.black);
this.setBorder(new MarginBorder(4));
this.setLayoutManager(new StackLayout());
((Shape) this).setLineWidth(1);
((Shape) this).setAntialias(1);
mLabel = new Label(text);
mLabel.setForegroundColor(ColorConstants.black);
mLabel.setFont(Display.getCurrent().getActiveShell().getFont());
this.add(mLabel);
Previous Topic:Why all connection routers do translateToRelative when routing?
Next Topic:zoom and color of SVG Images in GEF
Goto Forum:
  


Current Time: Sun Jul 06 11:36:18 EDT 2025

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

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

Back to the top