Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Right-aligned text
Right-aligned text [message #240534] Wed, 09 January 2008 14:45
Eclipse UserFriend
Originally posted by:

Hi all,

This is probably really stupid, but I'm having trouble right-aligning
text in GEF. The text is drawn using graphics.drawText() with a
variable-width font. I tried creating a separate figure for the text,
with the parent having a BorderLayout, and the layout constraint of the
text figure set to BorderLayout.RIGHT. This doesn't work, because when
the paintChildren() method of figure is called, the text figure has a
width of 0, therefore does not intersect with the clip, and does not get

I could use FontMetrics to get the average char width, but that won't
work all the time, I need the width of the particular text I want to draw.

Thanks in advance

Matt D.
Previous Topic:Zest - Overlapping Nodes
Next Topic:Accessibility problems on Figure.
Goto Forum:

Current Time: Sun Jun 24 19:00:41 GMT 2018

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

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

Back to the top