Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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] Mon, 30 January 2012 01:46 Go to next message
Gerrit van Doorn is currently offline Gerrit van Doorn
Messages: 15
Registered: January 2012
Junior Member
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 17:15 Go to previous message
Gerrit van Doorn is currently offline Gerrit van Doorn
Messages: 15
Registered: January 2012
Junior Member
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: Fri Oct 24 16:17:10 GMT 2014

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

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