It seems that the "inheritance" (non-inline) style definition in the .shape
model is not working if defined at the top-level of a Shape.
I defined the following styles:
style MyModelDefaultStyle {
description = "The default style of the model diagram type."
background-color = transparent
}
style MyElementStyle {
description = "The style for element representation."
background-color = light-green
}
And I defined the following shape:
shape MyElementShape style MyElementStyle
{
<...>
}
When I draw the element in the editor, it uses "MyModelDefaultStyle" (the
element has a transparent background). I think the error is located in the
generation of the Add feature. It looks like this:
public PictogramElement add(final IAddContext context) {
// ...
final ISprayStyle style = new MyModelDefaultStyle();
final ISprayShape shape = new MyElementShape(getFeatureProvider());
// ...
}
but it should be
public PictogramElement add(final IAddContext context) {
// ...
final ISprayStyle style = new MyElementStyle();
final ISprayShape shape = new MyElementShape(getFeatureProvider());
// ...
}
As workaround I currently don't define styles for my shapes at toplevel, but
for their graphical childs (rectangles etc.), which works fine:
shape MyElementShape
{
...
rectangle style MyElementStyle {
...
}
}
Original issue reported on code.google.com by t.fische...@gmail.com on 31 Jul 2013 at 2:57
Original issue reported on code.google.com by
t.fische...@gmail.com
on 31 Jul 2013 at 2:57