Prev | Next |
Assign Icons To Toolbox Items
When you create a stereotyped model element to define an element or connector that is represented in a Diagram Toolbox page, you can define the image that is displayed against both the element name in the Browser window and the element or connector type in the Toolbox page, by assigning the special attribute icon to the Stereotype element.
This image definition for the Toolbox item can be overridden or replaced by extending the ToolboxItemImage Metaclass, a process that is generally optional. However, if you want to show an icon against an item on a hidden sub-menu, you must use this method; the system picks up the ToolboxItemImage definition as the icon for the hidden menu item.
If you do not use either the icon attribute or the ToolboxItemImage Metaclass to define the Toolbox icon, the image defaults to the one used for the standard UML model element that has been extended. If there is no such image, the icon uses the system default generic 'Toolbox Item' image.
Extend the ToolboxItemImage Metaclass
Step |
Action |
See also |
---|---|---|
1 |
Create a new Stereotype element in the same Toolbox profile as the Toolbox item. |
|
2 |
Give the Stereotype element the same name as the element that it is assigning an image to; for example: MyProfile::MyStereo(UML::Class) |
|
3 |
Give the Stereotype element the special attribute Icon with Initial Value set to the full path and file name of the image to be used. The icon image is a 16x16 pixel bitmap file; for a transparent background use light gray - RGB(192,192,192). |
Special Attributes |
4 |
Create a Metaclass element named ToolboxItemImage and create an Extension association from the Stereotype element to this Metaclass. |