Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » ScrollPane is not scrolling!
ScrollPane is not scrolling! [message #221273] Fri, 11 August 2006 09:12
Eclipse UserFriend
Originally posted by: zouzhile.gmail.com

Hi, I am trying out a ScrollPane. My draw2D diagrams has a top figure
which simply serves as a container to add other figures. The top figure
is then composed of two figures: one is a scrollpane. which is used to
hold some small figures serving as items; the other figure is used to
shown the detail of the selected item figure in the scrollpane. it's
something like the picture below:
--------------------------------------------
| |
| -------- ------------------------ |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| -------- ------------------------- |
| |
--------------------------------------------

and the code is concerned with the scrollpane and top figure is this:
public class TopContainerFigure extends FreeformLayeredPane
{

public TopContainerFigure()
{
super();
this.setLayoutManager(new FreeformLayout());
this.setBackgroundColor(ColorConstants.white);
this.setOpaque(true);
ScrollPane scrollPane= new ScrollPane();
scrollPane.setBounds(new Rectangle(10,10, 120,9*60+10*7));
this.buildDiagram(scrollPane);
ScrollBar scrollBar= new ScrollBar();
scrollBar.setHorizontal(false);
scrollPane.setVerticalScrollBar(scrollBar);
this.add(scrollPane);

}
private void buildDiagram(ScrollPane scrollPane)
{
for(int i=0; i<20; i++)
{
PluginPointItemFigure figure= new PluginPointItemFigure(null);
figure.setBounds(new Rectangle(10,10*(i+1)+i*60,120,60));
scrollPane.getViewport().add(figure);
// scrollPane.add(figure) also not work
}
}
you see, i added 20 figures to the viewport, and only eight and a half
figures can be displayed and the scroll bar just didn't appear. So
what's wrong?
any idea?

Best Regards
Robin
Previous Topic:Error when Using of Timer
Next Topic:[Draw2d] BorderLayout.CENTER and spanning over available space
Goto Forum:
  


Current Time: Mon May 13 21:20:34 GMT 2024

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

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

Back to the top