Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Re: Changing the size of scrollbar
Re: Changing the size of scrollbar [message #179689] Fri, 29 April 2005 15:00 Go to next message
Eclipse UserFriend
Originally posted by: jdelgad.correo.ugr.es

Hi,

two days ago, I asked for changing the size of a scroll-bar which is
contained inside a figure. Here I post the code. If you can help me in
changing the size of the scroll bar (because the border of the figure
hides the half of the scroll bar), please, tell me how. Thank you very
much.


...

public ComplexFigure() {
setBorder(new ComplexFigureBorder());
ScrollPane scrollpane = new ScrollPane();
pane = new FreeformLayer();
pane.setLayoutManager(new FreeformLayout());
setLayoutManager(new StackLayout());
add(scrollpane);
scrollpane.setViewport(new FreeformViewport());
scrollpane.setContents(pane);


setBackgroundColor(new Color(null, 230, 230, 230));
}
...

public class ComplexFigureBorder extends AbstractBorder {

...
public void paint(IFigure figure, Graphics g, Insets in) {
Rectangle r = figure.getBounds().getCropped(in);

g.setForegroundColor(new Color(null, 222, 220, 122));
g.setBackgroundColor(new Color(null, 222, 220, 122));

//Se dibuja el borde grueso
g.fillRectangle(r.x, r.y+2, r.width, 12);
g.fillRectangle(r.x, r.bottom() - 14, r.width, 12);
g.fillRectangle(r.x, r.y + 2, 12, r.height - 4);
g.fillRectangle(r.right() - 12, r.y + 2, 12, r.height - 4);

}
...
}


Can you help me? Thank you very much.

--Jose.
Re: Changing the size of scrollbar [message #179823 is a reply to message #179689] Sun, 01 May 2005 21:47 Go to previous message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
Randy already answered your question then. You don't have to make the
scrollbar thinner. Your border should return proper insets and things will
be fine. Look at other subclasses of AbstractBorder.


"Jose" <jdelgad@correo.ugr.es> wrote in message
news:0cc9536c711ea89630b4303f9fbe2013$1@www.eclipse.org...
> Hi,
>
> two days ago, I asked for changing the size of a scroll-bar which is
> contained inside a figure. Here I post the code. If you can help me in
> changing the size of the scroll bar (because the border of the figure
> hides the half of the scroll bar), please, tell me how. Thank you very
> much.
>
>
> ..
>
> public ComplexFigure() {
> setBorder(new ComplexFigureBorder());
> ScrollPane scrollpane = new ScrollPane();
> pane = new FreeformLayer();
> pane.setLayoutManager(new FreeformLayout());
> setLayoutManager(new StackLayout());
> add(scrollpane);
> scrollpane.setViewport(new FreeformViewport());
> scrollpane.setContents(pane);
>
>
> setBackgroundColor(new Color(null, 230, 230, 230));
> }
> ..
>
> public class ComplexFigureBorder extends AbstractBorder {
>
> ..
> public void paint(IFigure figure, Graphics g, Insets in) {
> Rectangle r = figure.getBounds().getCropped(in);
>
> g.setForegroundColor(new Color(null, 222, 220, 122));
> g.setBackgroundColor(new Color(null, 222, 220, 122));
>
> //Se dibuja el borde grueso
> g.fillRectangle(r.x, r.y+2, r.width, 12);
> g.fillRectangle(r.x, r.bottom() - 14, r.width, 12);
> g.fillRectangle(r.x, r.y + 2, 12, r.height - 4);
> g.fillRectangle(r.right() - 12, r.y + 2, 12, r.height - 4);
>
> }
> ..
> }
>
>
> Can you help me? Thank you very much.
>
> --Jose.
>
>
Previous Topic:Cannot select/move/resize EditParts directly
Next Topic:Grid/Rulers in editor (example or document)
Goto Forum:
  


Current Time: Thu Apr 18 05:16:51 GMT 2024

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

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

Back to the top