Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » fillGradient on a Figure
fillGradient on a Figure [message #199623] Mon, 17 October 2005 14:53 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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.
Previous Topic:Filtering out nodes and connections from a diagram results in dangling connections in filtered state
Next Topic:Outline with a Tree
Goto Forum:
  


Current Time: Sun Dec 08 00:18:38 GMT 2024

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

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

Back to the top