[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] Re: Correct Layout Procedure?

The way I understand this is: If you use a layout manager provided in GEF, you don't have to calculate the preferred size because it is provided to you. Take a look at the source code of one of the layout manager and look for getPreferredSize() for more information. When you create your own layout manager, however, you will have to calculate the minimum size and the preferred size by yourself.


Daniel Rozeboom wrote:
Hi there,

I have a situation where I have a container (A) that has children (B), each of which has children of its own (C). The container (A) resides in a document which has an XYLayout, so when A is asked to refresh visuals, I call setLayoutConstraint on the parent with the preferred size. However, does this preferred size need to be calculated manually from the children (B)? Likewise, when each of the children (B) is in refreshVisuals, do they need to set a preferred dimension calculated manually using the sizes of their children (C)?
What's the correct way to do this? I'm wondering if GEF handles this for me, because right now I'm doing a bunch of calculations with insets and children's edit parts' figures' sizes and whatnot. Basically I want A to be large enough to accomodate all of the figures of B, which are each in turn large enough to accomodate all of the figures of C, which are each sized on the basis of a model constraint. Thanks in advance.


- Daniel