Question

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 http://img115.yfrog.com/img115/4946/componentwithopacity.jpg

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

Was it helpful?

Solution

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

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top