Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Problem with Figure and ScrollPane!
Problem with Figure and ScrollPane! [message #145604] Fri, 30 July 2004 08:18 Go to next message
Eclipse UserFriend
Originally posted by: mastr.arcor.de

Hello!

I want to let my EditPart return a Figure/ScrollPane which will contain
the figures of the EditPart's children.

Problem is, that I or GEF can't add a new figure to the ScrollPane because
this has to provide a view. Only adding figures to the view will show them
inside the ScrollPane.

So how can I convince GEF to put the child figures inside the ScrollPane.

Hope someone can help.
Thanks in advance, Martin.
Re: Problem with Figure and ScrollPane! [message #145677 is a reply to message #145604] Fri, 30 July 2004 11:25 Go to previous message
Eclipse UserFriend
Originally posted by: mastr.arcor.de

Martin S. wrote:


> I want to let my EditPart return a Figure/ScrollPane which will contain
> the figures of the EditPart's children.

> Problem is, that I or GEF can't add a new figure to the ScrollPane because
> this has to provide a view. Only adding figures to the view will show them
> inside the ScrollPane.

> So how can I convince GEF to put the child figures inside the ScrollPane?

Ok, I got it myself.

public class RelationFigure extends Figure {

private final Figure contents;

public RelationFigure() {
contents = new Figure();
createContents();
}

protected void createContents() {
setOpaque(false);
setBackgroundColor(ColorConstants.white);

contents.setLayoutManager(new FlowLayout(false));

ScrollPane scroll = new ScrollPane();
scroll.setView(contents);

this.add(scroll);
}

public IFigure getContentPane() {
return contents;
}
}

In the EditPart you have to override the getContentPane() method and
return the figure's getContentPane() method.

CU, Martin.
Previous Topic:Questing Regarding GrabHandle and Dragging
Next Topic:Horizontal?!? FlowLayout
Goto Forum:
  


Current Time: Fri Apr 26 04:39:22 GMT 2024

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

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

Back to the top