Visibility can be used to constrain the usage of a UML element. It can be set for specific elements in class diagrams, package diagrams and use case diagrams. Allowed values are:
The element is visible to all elements that can access the contents of the element that owns it. This is the default option.
The element is only visible inside the element that owns it.
The element is visible to elements that have a generalization relationship to the element that owns it.
The element is owned by an element that is not a package, and is visible to elements that are in the same package as its owning element. Any element marked as having package visibility is visible to all elements within the nearest enclosing package (given that other owning elements have proper visibility). Outside the nearest enclosing package, an element marked as having package visibility is not visible.
Setting the visibility via the element properties
- In the diagram, click the element, and then click
In case of an attribute, operation, or extension point, the window is directly opened after clicking the element. to open the properties window.
- In visibility, click
- Close the properties window.
Setting the visibility via the visibility control
Alternatively, the visibility of an attribute or operation can be set by clicking the plus sign in front of the attribute or operation name. Repeatedly clicking it changes the visibility to private (-), protected (#), package (~), and back to public (+).