Skip to main content



      Home
Home » Eclipse Projects » GEF » How to Get the Real Size of a Figure
How to Get the Real Size of a Figure [message #162042] Fri, 17 December 2004 23:35 Go to next message
Eclipse UserFriend
Originally posted by: wudong.At.sklse.org

Hi, All:
I don't know if the sbject is proper. but my intension is :
When i create a figure, hasing a ToolbarLayout, and add some sub-figures(such as Label) to it. Just after that, i want to know the real size of the figure in other to put in on a proper position on the canvas.
the getSize() and getBounds always return the same value nomather what was added to the containing figure.

How to solve this problem?

It's urgent. hope some one can help me out.
Thank you.
Re: How to Get the Real Size of a Figure [message #162050 is a reply to message #162042] Sat, 18 December 2004 00:50 Go to previous message
Eclipse UserFriend
> I don't know if the sbject is proper. but my intension is :
> When i create a figure, hasing a ToolbarLayout, and add some
> sub-figures(such as Label) to it. Just after that, i want to know the real
> size of the figure in other to put in on a proper position on the canvas.
> the getSize() and getBounds always return the same value nomather what was
> added to the containing figure.

When in doubt try getPreferredSize(). And if you need to pass it hints, use
(-1, -1) which means that it should use whatever space it needs.

I hope this helps you.


--
Rob Grzywinski
Previous Topic:GEF & SWT
Next Topic:Modifying the Flow example
Goto Forum:
  


Current Time: Wed Jul 30 15:06:44 EDT 2025

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

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

Back to the top