Search code examples
javaeclipseswtdraw2d

how do I specify a transparent background colour on a draw2d Figure?


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


Solution

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