The diagram contains a shape. When you applied a stereotype on the element, the applied stereotype name is displayed on the shape below the name of the element. When an element is dropped form the model explorer to the diagram, the applied stereotype named is displayed on the shape. This is the same behavior for links.
Inside papyrus, it is possible to display the name of applied stereotype. To do that:
Apply a profile
Apply the stereotype
Resulted applied stereotype
It is possible to display properties of stereotypes as "comment", as "compartment", as "brace"
Properties of applied stereotype can be displayed as "brace". This is label that is set below the name, and contains a sequence of properties name with their values.
To do that:
Sequence of actions to display in brace
Properties of stereotypes displayed in brace
Properties of applied stereotype can be displayed as a compartment. This compartment contains all labels that are properties of the applied stereotype.
To do that:
Sequence of actions to display in compartment
Properties of stereotypes displayed in compartment
Properties of applied stereotype can be displayed as a comment. This comment representation that contains all labels that are properties of the applied stereotype. To do that:
Sequence of actions to display in comment
Properties of stereotype displayed in comment
The list of properties of stereotypes can be chosen by the user by using the property view or by writing a css. This choice runs for the 3 representations of applied stereotypes: brace, compartment, comment.
By using the property view, it is possible to select the list of property of stereotype. To do that:
Select properties by using the property view
By using CSS file:
Compartment[type=StereotypeCompartment]{ visible:true; } Compartment[type=StereotypeCompartment]>[property="derived"]{ visible:false; } Compartment[type=StereotypeCompartment]>[property="derivedFrom"]{ visible:false; }
The compartment is displayed and the property derived and derivedFrom are not displayed
Result by using the selection by CSS
The following CSS rules are implemented by default for all the Diagrams:
Shape[type=StereotypeComment]{ visible:false; } StereotypeComment Compartment[type=StereotypeBrace]{ visible:false; } Compartment[type=StereotypeCompartment]{ visible:false; } Compartment[type=StereotypeBrace]{ visible:false; } Label[type=StereotypeLabel]{ depth:"none"; } Here is some example of CSS to display the Stereotype: /* To modify the depth */ Label[type=StereotypeLabel]{ depth:"-1"; } /* To make the properties visible into compartment */ Compartment[type=StereotypeCompartment]{ visible:true; } /* Hide the property "allocatedTo" into the compartment */ Compartment[type=StereotypeCompartment]>[property="allocatedTo"]{ visible:false; } /* Hide all the properties into the Compartment of the stereotype Block */ Compartment[stereotype="SysML::Blocks::Block"]{ visible:false; } /* Display the Comment shape */ StereotypeComment{ visible:true; } /* Display the properties in Brace into the Comment*/ StereotypeComment Compartment[type=StereotypeBrace]{ visible:true; }
The stereotype name can be displayed by choosing the depth. I consists on choosing the size of the qualified name of the stereotype. full = all the qualified name 0= only the name of stereotype -1= the name of its parent + the name of the stereotype -2=the name of its great-parent+ the name of its parent + the name of the stereotype Using CSS:
Label[type=StereotypeLabel]{ depth:"-1"; }
By using the property view:
Select the depth the applied stereotype name
The display of stereotype can be removed by selection or by unapply stereotype or profile container
When the value associated to the property of stereotype has been modified, the display must be modified. It is possible to edit value of stereotype property by double click on the property in the diagram. Important: the property must be writable and Real are not yet editable.
Property of applied stereotype edition
It is possible to edit property of applied stereotype by using the property view:
Property edition for applied stereotypes in the property view