Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » ScrollPane question
ScrollPane question [message #215838] Wed, 10 May 2006 19:12
Eclipse UserFriend
Originally posted by: bandrews.nospam_bphnx.com

Hi,

I am trying to create a Figure container that contains a header
label and then a scrolling Figure under that which children will be
added to. The EditPart code I have below works except it scrolls the
header label too, so when the scrollbar is moved to the bottom, the
header label is hidden. I can see why it happens this way. ( Because
label is added to the contents before being added to the scroller. ) I
just don't know how to fix it. If I set up the children with a structure
like this.

Figure main
Label nameLabel
ScrollPane scrollPane
Figure scrollerContents

This also doesn't work, even though to me it seems logical. Can anyone
provide some hints on how this is supposed to be setup?

protected IFigure createFigure()
{
final DLBase model = ( DLBase ) getModel();

final IFigure contents = new Figure();
contents.setLayoutManager(new XYLayout());
contents.setSize(model.getSize());
contents.setOpaque(true);
contents.setBackgroundColor(new Color(null,model.getColor()));
final Label label = createLabel(model);
contents.add(label);
setNameLabel(label);
contents.setConstraint(label,new Rectangle(
0,0,model.getSize().width,NAME_LABEL_HEIGHT));

final ScrollPane scroller = new ScrollPane();

scroller.setHorizontalScrollBarVisibility(ScrollPane.NEVER);
scroller.setVerticalScrollBarVisibility(ScrollPane.AUTOMATIC );
scroller.setBorder(new LineBorder(ColorConstants.black));
scroller.setContents(contents);

mainContents = contents;
return scroller;
}


many thanks,

B
Previous Topic:unable to invoke
Next Topic:how to attach a label to a figure
Goto Forum:
  


Current Time: Sat Apr 20 10:54:04 GMT 2024

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

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

Back to the top