fillGradient on a Figure [message #199623] |
Mon, 17 October 2005 14:53 |
Eclipse User |
|
|
|
Originally posted by: prooteus_NOSPAM.gmx.net
Hi,
I've got a Figure which contains a title bar and a content pane. The
content pane is of type 'RectangleFigure'. I would like to fill the
content pane with a gradient color.
Overriding the paintFigure(Graphics g) method did not succeed:
paintFigure(Graphics g) {
super.paintFigure(g);
g.fillGradient(this.getContentPane().getClientArea(), true);
}
Then I thought of overriding the method fillShape(Graphics g) of
RectangleFigure but that did not work either. The colors aren't changed
in any way.
Could someone please give me a hint.
Thanks in advance.
Stefan
|
|
|
Re: fillGradient on a Figure [message #199637 is a reply to message #199623] |
Mon, 17 October 2005 15:52 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
Overriding fillShape() to invoke fillGradient(getBounds(), bool) should
work. Maybe you need to relaunch your application to see the change?
"Stefan Knieling" <prooteus_NOSPAM@gmx.net> wrote in message
news:dj0dsu$miv$1@news.eclipse.org...
> Hi,
>
> I've got a Figure which contains a title bar and a content pane. The
> content pane is of type 'RectangleFigure'. I would like to fill the
> content pane with a gradient color.
>
> Overriding the paintFigure(Graphics g) method did not succeed:
>
> paintFigure(Graphics g) {
> super.paintFigure(g);
> g.fillGradient(this.getContentPane().getClientArea(), true);
> }
>
> Then I thought of overriding the method fillShape(Graphics g) of
> RectangleFigure but that did not work either. The colors aren't changed
> in any way.
>
> Could someone please give me a hint.
>
> Thanks in advance.
> Stefan
>
|
|
|
Re: fillGradient on a Figure [message #199641 is a reply to message #199623] |
Mon, 17 October 2005 16:03 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
> Hi,
>
> I've got a Figure which contains a title bar and a content pane. The
> content pane is of type 'RectangleFigure'. I would like to fill the
> content pane with a gradient color.
> Overriding the paintFigure(Graphics g) method did not succeed:
>
> paintFigure(Graphics g) {
> super.paintFigure(g);
> g.fillGradient(this.getContentPane().getClientArea(), true);
> }
You could switch to using a plain Figure for the content pane and it
wouldn't cover up your gradient.
Or...
> Then I thought of overriding the method fillShape(Graphics g) of
> RectangleFigure but that did not work either. The colors aren't changed in
> any way.
Put a breakpoint to see if the method is called. Also, the foreground and BG
colors are important.
|
|
|
Re: fillGradient on a Figure [message #199649 is a reply to message #199641] |
Mon, 17 October 2005 16:42 |
Eclipse User |
|
|
|
Originally posted by: prooteus_NOSPAM.gmx.net
Hi,
> You could switch to using a plain Figure for the content pane and it
> wouldn't cover up your gradient.
I've done so and overridden paintFigure(Graphics g). Now the gradient
works fine :-)
> Put a breakpoint to see if the method is called. Also, the foreground
> and BG colors are important.
I put a breakpoint. The method fillShape(Graphics g) of RectangleFigure
was never called...
Thx a lot.
|
|
|
Re: fillGradient on a Figure [message #199653 is a reply to message #199649] |
Mon, 17 October 2005 20:57 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
Perhaps the figure had no size and therefore didn't paint?? fill is set to
true by default in Shape.
"Stefan Knieling" <prooteus_NOSPAM@gmx.net> wrote in message
news:dj0k8u$vni$1@news.eclipse.org...
> Hi,
>
>> You could switch to using a plain Figure for the content pane and it
>> wouldn't cover up your gradient.
>
> I've done so and overridden paintFigure(Graphics g). Now the gradient
> works fine :-)
>
>> Put a breakpoint to see if the method is called. Also, the foreground and
>> BG colors are important.
>
> I put a breakpoint. The method fillShape(Graphics g) of RectangleFigure
> was never called...
>
> Thx a lot.
|
|
|
Powered by
FUDForum. Page generated in 0.03277 seconds