Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to meaure the string(text) width?
How to meaure the string(text) width? [message #229528] Sun, 21 January 2007 06:06 Go to next message
Eclipse UserFriend
Originally posted by: zjg.robin.gmail.com

Hi,

I want to draw string in the figure, and I must know the width the string, how to get such info? I know that GC has such method to get it, but how to get GC in figure object?

Thanks. Robin
Re: How to meaure the string(text) width? [message #229546 is a reply to message #229528] Sun, 21 January 2007 16:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: anthony.cunningham.NOduolog.comSPAM

Can you use a label figure and add it to the figure?
Re: How to meaure the string(text) width? [message #229560 is a reply to message #229546] Mon, 22 January 2007 04:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: zjg.robin.gmail.com

Thank you.
With your clue, I found the util class FigureUtilities which can do this and that.
Re: How to meaure the string(text) width? [message #229579 is a reply to message #229560] Mon, 22 January 2007 11:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: anthony.cunningham.NOduolog.comSPAM

I'll have to do this myself later and thought I'd just get the dimensions
of a label that I added the text to. Can you detial how you did it if you
get it to work.

Anthony
Re: How to meaure the string(text) width? [message #229587 is a reply to message #229579] Mon, 22 January 2007 14:28 Go to previous message
Alex Boyko is currently offline Alex BoykoFriend
Messages: 200
Registered: July 2009
Senior Member
If you need to draw a string inside a node, perhaps, you all you need is
indeed create a GEF's label figure and add it to the node figure. For the
node figure install GEF's tool bar layout or stack layout manager, this
will resize the node figure to fit the entire label figure (i.e. to fit
the whole string). The closest example to this would StickyNoteFigure from
GEF logic example editor.
Hope this helps.

Cheers,
Alex
Previous Topic:Execution problem with GEF text example
Next Topic:fixing center of window to be 0,0 with FreeformLayer
Goto Forum:
  


Current Time: Thu Dec 02 16:02:34 GMT 2021

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

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

Back to the top