Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » extend the size of a figure
extend the size of a figure [message #236485] Thu, 28 June 2007 13:07 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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 ?
Previous Topic:Code Generation
Next Topic:Change mouse image on mouse-over
Goto Forum:
  


Current Time: Fri Aug 12 20:28:59 GMT 2022

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

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

Back to the top