Skip to main content



      Home
Home » Eclipse Projects » GEF » Auto-positioning nodes in the root edit part
Auto-positioning nodes in the root edit part [message #75739] Wed, 16 April 2003 00:13 Go to next message
Eclipse UserFriend
Originally posted by: m.spork.NOSPAMtpg.com.au

Hi,

How can I automatically position elements in the root edit part
depending on how big the canvas is?

For example - I want to position a child node about midway on the
vertical (left-aligned). Where do I put the code so that the child
node is repositioned correctly whenever the canvas is resized - and
how do I get the new size of the canvas?

Thanks

Murray
Re: Auto-positioning nodes in the root edit part [message #75760 is a reply to message #75739] Wed, 16 April 2003 10:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

The Viewport figure will position its "contents" figure such that it fills
the entire available space (i.e., the canvas minus the scrollbars if they
are visible). Layout is done top-down, so once your contents figure has
been placed, it will then layout, and it can place its child in its center
location.


"Murray Spork" <m.spork@NOSPAMtpg.com.au> wrote in message
news:oqlp9v8of3ikd8sso93c3tf4k9u4j379jd@4ax.com...
>
> Hi,
>
> How can I automatically position elements in the root edit part
> depending on how big the canvas is?
>
> For example - I want to position a child node about midway on the
> vertical (left-aligned). Where do I put the code so that the child
> node is repositioned correctly whenever the canvas is resized - and
> how do I get the new size of the canvas?
>
> Thanks
>
> Murray
Re: Auto-positioning nodes in the root edit part [message #75909 is a reply to message #75760] Wed, 16 April 2003 23:58 Go to previous message
Eclipse UserFriend
Originally posted by: m.spork.NOSPAMtpg.com.au

On Wed, 16 Apr 2003 10:43:54 -0400, "Randy Hudson" <none@us.ibm.com>
wrote:

>The Viewport figure will position its "contents" figure such that it fills
>the entire available space (i.e., the canvas minus the scrollbars if they
>are visible). Layout is done top-down, so once your contents figure has
>been placed, it will then layout, and it can place its child in its center
>location.

Hi Randy,

I'm still having some difficulty with this.

I'm not sure where to put the code to do the laying out of the child
elements. I tried putting it in the refreshVisuals() method of my
contents edit part - this method is called sometime shortly after the
contents editpart is added to the root - but it appears that at the
time it is called the Viewport figure has not been sized to the full
canvas (it shows a height of 32 and width of 64).

Can you advise as to what method in what class I should override to
put this laying out code in?

Thanks

Murray

>
>"Murray Spork" <m.spork@NOSPAMtpg.com.au> wrote in message
>news:oqlp9v8of3ikd8sso93c3tf4k9u4j379jd@4ax.com...
>>
>> Hi,
>>
>> How can I automatically position elements in the root edit part
>> depending on how big the canvas is?
>>
>> For example - I want to position a child node about midway on the
>> vertical (left-aligned). Where do I put the code so that the child
>> node is repositioned correctly whenever the canvas is resized - and
>> how do I get the new size of the canvas?
>>
>> Thanks
>>
>> Murray
>
Previous Topic:splitter layout
Next Topic:resizing shapes smaller than 8 pixels
Goto Forum:
  


Current Time: Sun Jun 08 18:36:25 EDT 2025

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

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

Back to the top