Enumerator attributes give the user an additional way to employ filtering: object instances can be filtered (and thus hidden) depending on the value of their enumerator attribute. For example, if a object has an enumerator attribute with values Red, Green and Blue, it can be shown when the attribute has the value Green and hidden from view if it has the value Red or Blue. The filtering is done based on the list of allowed enumerator values. If this list is empty, the object instance will never be displayed.
This is the only way to filter objects depending on their values rather than on the rule on which they are based on in the meta-model.
Let us illustrate the color example described above.
The type Pixel has an enumerator attribute Color with three enumerator values: Red, Green and Blue. There are three object instances of the type Pixel named Red Pixel, Green Pixel and Blue Pixel; the Color attribute values of these three objects are Red, Green and Blue, respectively.
If all the three enumerator values are checked in the filter, all three instances of Pixel are show. If we now uncheck the value Red, only the pixels having Green or Blue as their attribute value will be shown. Furthermore, as the enumerator filtering becomes active, also the object which do not have a defined value for the attribute (when no default value has been defined) disappear from view.
- The enumeration attribute and all the enumerator values are checked: all the objects are shown, no matter what they enumerator value is (and whether it is defined or not).
- The enumeration attribute is checked and one or more (but not all) enumerator values are unchecked: only objects whose enumerator value corresponds to the checked values are shown. Objects with no defined value (when there is no default value) are hidden.
- The enumeration attribute is checked but all the enumerator values are unchecked: only objects that have no defined value for the attribute are shown.
- The enumeration attribute as well as all the enumerator values are unchecked: there is no filtering based on this attribute (the attribute is completely hidden in this projection).
For instance, let us imagine an object of type System with children of type System. The System type has an enumeration attribute called IsVisible with values Visible and Invisible. You can now create object instances named System 1 and System 2 (System 2 being a children of System 1) with enumerator values Invisible and Visible, respectively. If you filter out the Invisible value in your projection, System 1 shall now be hidden from view but you shall nevertheless be able to see System 2 (the child of System 1) in its stead.