views:

86

answers:

2

I'm writing an eclipse plugin, and I'm layering some simple figures (i.e. view elements) together to create diagrams.

A simple component looks like this

A simple component with rendering issues

The drum icon on the right is part of a tiny widget drawer.

And the incomplete line underneath it is trying to represent multiplicity, but it's being blocked by the widget drawer.

I tried really hard to get a transparent background on the Figure, but the SWT colour class has no way to specify an alpha or transparent colour.

has anyone run into this problem before? How can I make my draw2d Figure background transparent so I can see stuff behind it.

This a small example of various other opacity related issues I've encountered. Solving this would fix a wide range of visual issues.

Any help is greatly appreciated. CV

A: 

So IFigure.setOpaque(false) doesn't do it?

Jonathan Feinberg
hahaha! I did try that! but I was using draw2d Panels, which override isOpaque with always true. so setOpaque was getting ignored. I changed all my container Figures to just Figure and bam, the widget is see through! Thank you!
CVertex
A: 

Simply set the alpha from 0 to 255 to your liking. See Graphics#setAlpha(int) during your paint event or see Shape - I think setAlpha(int) exists there too.

arcticpenguin