extend the size of a figure [message #236485] |
Thu, 28 June 2007 13:07 |
Eclipse User |
|
|
|
Originally posted by: alexjaquet.gmail.com
I'm looking for the way I should take to resize a figure when it's
content is bigger than it's initial size.
Is that managed by the edit policy or by the layout manager ?
Thanks for any pointer.
Alexandre
|
|
|
Re: extend the size of a figure [message #236502 is a reply to message #236485] |
Fri, 29 June 2007 11:53 |
Eclipse User |
|
|
|
Originally posted by: alexjaquet.gmail.com
Alexandre Jaquet a écrit :
> I'm looking for the way I should take to resize a figure when it's
> content is bigger than it's initial size.
>
> Is that managed by the edit policy or by the layout manager ?
>
> Thanks for any pointer.
>
> Alexandre
I've begin the creation of a layout manager. So I've placed the
following code inside the layout method :
Rectangle parentDimension = getParentDimension(parent);
int px = parentDimension.x;
int totalHeightParent = parentDimension.y + parentDimension.height;
int py = parentDimension.x;
int totalChildHeight = 0;
for (int i = 0; i < numChildren; i++) {
child = (IFigure)children.get(i);
totalChildHeight += totalChildHeight + child.getBounds().y +
child.getBounds().height;
}
if (totalChildHeight >= totalHeightParent ) {
int width = parent.getBounds().width;
int xP = parent.getBounds().x;
int yP = parent.getBounds().y;
int height = parent.getBounds().height + 400;
Rectangle bounds = new Rectangle(xP, yP, width,height);
parent.setBounds(bounds);
}
Sometime the code work, sometime not, any idea why ?
|
|
|
Powered by
FUDForum. Page generated in 0.03846 seconds