Skip to main content



      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 01: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 11: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] Sun, 21 January 2007 23: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 06: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 09:28 Go to previous message
Eclipse UserFriend
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:EditPart figures in feedback layer
Next Topic:Draw2d for UML sequence diagram lifelines
Goto Forum:
  


Current Time: Thu May 15 13:07:34 EDT 2025

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

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

Back to the top