Right-aligned text [message #240534] |
Wed, 09 January 2008 14:45 |
Eclipse User |
|
|
|
Originally posted by: matt.querix.com
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
drawn.
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.
|
|
|
Powered by
FUDForum. Page generated in 0.03477 seconds