Associating a stereotype with a bitmap

IBM® Rational® Rhapsody® provides a set of predefined bitmaps in <product installation folder>\Share\PredefinedPictures. You can associate these icons with Rational Rhapsody stereotypes and classes.

Procedure

  1. Define a stereotype of your own or select one of the existing stereotypes.
  2. Select this stereotype for a class.
  3. Rename an existing .bmp file (or add a new file) in the PredefinedPictures directory so it has the same name as the stereotype.
  4. Drag-and-drop the class into an object model diagram.
  5. Right-click the class and then select Display Options.
  6. Under Show stereotype, select Icon; change Display name to Name only.

Results

The bitmap is included in the class box.

Class with bitmap on diagram

To change the bitmap background to transparent (so only the graphic itself is visible), set the General::Graphics::StereotypeBitmapTransparentColor property to the RGB value of the bitmap background.

The following figure shows bitmaps with transparent backgrounds.

Class with bitmaps with transparent backgrounds on diagram

Feedback