Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How see root figure image through transparent child
How see root figure image through transparent child [message #217998] Fri, 16 June 2006 10:41 Go to next message
Eclipse User
Originally posted by: tuhlmann.agynamix.de

Hi all,

I have a question about transparent figures. I've searched older posts
and found hints but couldn't solve my problem. So please bear with me :)

I have created a ScalableFreeformRootEditPart and a top level EditPart
for my model which draws a FreeformLayer.

I'm overwriting paintFigure() in the FreeformLayer to make it paint an
image in the back (found that tip in the archive- thanks!) That one
works well.

Now I create child figures (a Panel with a StackLayout and other IFigure
objects in there) on top of that root figure.

I want them to be transparent so that the image would shine through.
Transparency works if I set the background color of the root figure.
That color would then appear in my child figures. But that mechanism
does not work with the image.

I hope you can give me some clues so I get this puzzle piece finally in
place.

Thank you very much,
Torsten.
Re: How see root figure image through transparent child [message #218023 is a reply to message #217998] Fri, 16 June 2006 16:59 Go to previous messageGo to next message
Eclipse User
Originally posted by: lamont_gilbert.rigidsoftware.com

Torsten Uhlmann wrote:

> Hi all,
>
> I have a question about transparent figures. I've searched older posts
> and found hints but couldn't solve my problem. So please bear with me :)
>
> I have created a ScalableFreeformRootEditPart and a top level EditPart
> for my model which draws a FreeformLayer.
>
> I'm overwriting paintFigure() in the FreeformLayer to make it paint an
> image in the back (found that tip in the archive- thanks!) That one
> works well.
>
> Now I create child figures (a Panel with a StackLayout and other IFigure
> objects in there) on top of that root figure.
>
> I want them to be transparent so that the image would shine through.
> Transparency works if I set the background color of the root figure.
> That color would then appear in my child figures. But that mechanism
> does not work with the image.
>
> I hope you can give me some clues so I get this puzzle piece finally in
> place.
>
> Thank you very much,
> Torsten.

So your saying the background color shines through the children but the
background image does not?


--
Respectfully,

CL Gilbert
"Verily, verily, I say unto you, He that entereth not by the door() into the
sheepfold{}, but climbeth up some other *way, the same is a thief and a
robber."
Re: How see root figure image through transparent child [message #218040 is a reply to message #218023] Sat, 17 June 2006 06:20 Go to previous messageGo to next message
Eclipse User
Originally posted by: tuhlmann.agynamix.de

CL [dnoyeb] Gilbert wrote:
> Torsten Uhlmann wrote:
>
>> Hi all,
>>
>> I have a question about transparent figures. I've searched older posts
>> and found hints but couldn't solve my problem. So please bear with me :)
>>
>> I have created a ScalableFreeformRootEditPart and a top level EditPart
>> for my model which draws a FreeformLayer.
>>
>> I'm overwriting paintFigure() in the FreeformLayer to make it paint an
>> image in the back (found that tip in the archive- thanks!) That one
>> works well.
>>
>> Now I create child figures (a Panel with a StackLayout and other IFigure
>> objects in there) on top of that root figure.
>>
>> I want them to be transparent so that the image would shine through.
>> Transparency works if I set the background color of the root figure.
>> That color would then appear in my child figures. But that mechanism
>> does not work with the image.
>>
>> I hope you can give me some clues so I get this puzzle piece finally in
>> place.
>>
>> Thank you very much,
>> Torsten.
>
> So your saying the background color shines through the children but the
> background image does not?
>

Yes, thats the case. If I set a background color (and an image), this
one shines through the children. If I only set an image I see white
shining through the children but never the image.

Torsten.
Re: How see root figure image through transparent child [message #218811 is a reply to message #218040] Mon, 03 July 2006 07:41 Go to previous message
Eclipse User
Originally posted by: tuhlmann.agynamix.de

To answer myself:

I have subclassed the Panel that hold my child figure:

itsFigure = new Panel() {
@Override
protected void paintFigure(Graphics graphics)
{
Image img = getBackgroundImage();
if (img != null)
{
graphics.drawImage(img, 0, 0);
} else {
super.paintFigure(graphics);
}
}
};

The image is a 1 pixel transparent gif image. Works very nice!

Torsten Uhlmann wrote:
> CL [dnoyeb] Gilbert wrote:
>> Torsten Uhlmann wrote:
>>
>>> Hi all,
>>>
>>> I have a question about transparent figures. I've searched older posts
>>> and found hints but couldn't solve my problem. So please bear with me :)
>>>
>>> I have created a ScalableFreeformRootEditPart and a top level EditPart
>>> for my model which draws a FreeformLayer.
>>>
>>> I'm overwriting paintFigure() in the FreeformLayer to make it paint an
>>> image in the back (found that tip in the archive- thanks!) That one
>>> works well.
>>>
>>> Now I create child figures (a Panel with a StackLayout and other IFigure
>>> objects in there) on top of that root figure.
>>>
>>> I want them to be transparent so that the image would shine through.
>>> Transparency works if I set the background color of the root figure.
>>> That color would then appear in my child figures. But that mechanism
>>> does not work with the image.
>>>
>>> I hope you can give me some clues so I get this puzzle piece finally in
>>> place.
>>>
>>> Thank you very much,
>>> Torsten.
>>
>> So your saying the background color shines through the children but the
>> background image does not?
>>
>
> Yes, thats the case. If I set a background color (and an image), this
> one shines through the children. If I only set an image I see white
> shining through the children but never the image.
>
> Torsten.
Previous Topic:GEF editor in Eclipse RCP
Next Topic:Bad Georgia State Download
Goto Forum:
  


Current Time: Thu Apr 17 05:43:51 EDT 2014

Powered by FUDForum. Page generated in 0.02630 seconds