Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Slider using GEF and draw2D
Slider using GEF and draw2D [message #467920] Mon, 03 August 2009 11:47 Go to next message
Manpreet is currently offline ManpreetFriend
Messages: 7
Registered: July 2009
Junior Member
Hello Guys,

I'm trying to implement slider functionality in my application based on
GEF/draw2D. I have seen previous post where is suggest to implements it as
follows:

MyScrollBar scrollBar = new MyScrollBar();
scrollBar.setBackgroundColor(ColorConstants.red);
panel.add(scrollBar);
layout.setConstraint(scrollBar, new Rectangle(0, 0, 20, 70));

However I'm still not able to do so because of my ignorance to GEF/draw2d.
I'm not able to figure out how to initialize panel and layout object?

As a alternative what I tried doing is extend Figure class, I have also
tried extending ScrollBar and ScrollPane. When I extend scrollbar I do see
the scrollbar but I'm not able to attach label as well as my Max/Min
display which I want user to see.

If there is any sample out there it'll be of great use.

BTW: I've tried looking into GEF example etc and found many similar apps
but I'm still not able to work it out.

Thanks for your help.
Re: Slider using GEF and draw2D [message #467933 is a reply to message #467920] Mon, 03 August 2009 12:18 Go to previous message
Manpreet is currently offline ManpreetFriend
Messages: 7
Registered: July 2009
Junior Member
I just thought adding code snippet of what I'm trying to do will be useful.

public class QualiaScrollBar extends Figure {
private IFigure pane;
public QualiaScrollBar(EditPart part) {
ScrollPane scrollpane = new ScrollPane();
pane = new FreeformLayer();
pane.setLayoutManager(new FreeformLayout());
Label label = new Label("Hello World");
scrollpane.getHorizontalScrollBar().setVisible(true);
pane.add(label);
setLayoutManager(new StackLayout());

add(scrollpane);
scrollpane.setViewport(new FreeformViewport());
scrollpane.setContents(pane);
setBackgroundColor(ColorConstants.listBackground);
setOpaque(true);
}
}
Previous Topic:Help for adjusting elements
Next Topic:Need Help to make connection
Goto Forum:
  


Current Time: Fri Apr 26 01:28:11 GMT 2024

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

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

Back to the top