Problem with transparancy in Styles [message #778465] |
Thu, 12 January 2012 11:28  |
Eclipse User |
|
|
|
I have the impression that the transparancy set in a style is ignored.
When i register a style with transparency like this:
public static Style getStyleForOverlay(Diagram diagram) {
final String styleId = "OVERLAY"; //$NON-NLS-1$
Style style = findStyle(diagram, styleId);
IGaService gaService = Graphiti.getGaService();
if (style == null) { // style not found - create new style
style = gaService.createStyle(diagram, styleId);
...
style.setTransparency(0.7d);
}
return style;
}
A Figure is not transparent:
Rectangle rectangle = gaService.createRectangle(...);
....
rectangle.setStyle(StyleUtil.getStyleForOverlay(diagram));
only if i add:
rectangle.setTransparency(0.7d);
Is this an issue or am I doing something wrong?
Thanks in advance
Veit
|
|
|
|
Re: Problem with transparancy in Styles [message #780365 is a reply to message #780230] |
Tue, 17 January 2012 12:04  |
Eclipse User |
|
|
|
Hi,
thanks for the response. I gonna try the 0.9 creators then ;)
Veit
Am 17.01.2012 13:13, schrieb Michael Wenz:
> Hi,
>
> well, partly an issue, partly wrong... ;-)
>
> Styles and the default values do not really fit together. We have done
> some rework on the styles for Graphiti 0.9.0 (see
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=352542). The standard
> creation methods in the GAService do nothing about any default values
> defined in the Graphiti metamodel; on the other hand styles are only
> checked if no value (not even a default value) is set. In order to make
> the transparency from the style being used, you have to unset the
> transparency for your rectangle. In order to overcome this we have
> introduced createPlain methods in the service that already do this; they
> should be used starting 0.9.0 when working with styles. Until then,
> unsetting will do the job.
>
> Michael
>
|
|
|
Powered by
FUDForum. Page generated in 0.26145 seconds