If you define your class with a stereotype (say <<class →), you can then assign the stereotype to a shape-script. If you specify only a decoration, this should use the default drawing for the class and add your decoration, which can be conditional based on the scope property of the class:
decoration X { if(hasproperty("scope","public")) print("P"); }
This prints P in the upper left corner of the open class. However, you may also have an icon.
Unfortunately, I cannot find a way to assign the shape-script to the standard of a non-stereotyped class. Does anyone know how to do this?
Screwtape
source share