Share via


How to: Add a Geometry Shape to a Domain-Specific Language Definition

Geometry shapes represent how domain classes will appear in a generated designer (for example, what fill color and text color a domain class will have). Geometry shapes specify a geometric, line-based outline as its principal characteristic. For more information, see Geometry Shape (Domain-Specific Language Designer).

Note

If you want to use an image (for example, a .jpg or .bmp file) to represent your domain class, you can use an image shape instead. For more information, see How to: Add an Image Shape to a Domain-Specific Language Definition.

After you create and define a geometry shape, you must map it to a domain class. For more information, see How to: Add a Domain Class to a Domain-Specific Language Definition and How to: Map Elements By Using the Diagram Element Map Tool.

To add a geometry shape to a domain-specific language definition

  1. In the Toolbox, on the Dsl Designer tab, drag a geometry shape onto the diagram surface of the Domain-Specific Language Designer.

    A geometry shape that is named GeometryShape1 is created in the designer definition under the Diagram Elements swimlane.

    Note

    You can also double-click a geometry shape to add it to the Diagram.

  2. Optionally, add decorators, such as text and an icon, to the geometry shape. For more information, see How to: Add a Decorator.

  3. Optionally, add domain properties to the geometry shape.

    For example, you could use a domain property to indicate that the geometry shape represents a group of geometry shapes. For more information about domain properties, see How to: Add a Domain Property.

  4. Set any properties in the Properties window.

    For example, you can change the default value of the FillColor property from white to yellow and the Geometry property from rectangle to circle.

  5. Map the geometry shape to the domain class or named domain class by using the Diagram Element Map tool. For more information, see How to: Map Elements By Using the Diagram Element Map Tool.

  6. Create a toolbox element tool by using DSL Explorer. For more information, see How to: Add an Element Tool.

  7. Click Transform All Templates in Solution Explorer.

  8. On the Build menu, click Rebuild Solution to start a Visual Studio experimental build to display how the geometry shape has been defined and mapped to a domain class.

See Also

Concepts

Domain-Specific Language Designer Terminology Overview

Walkthrough: Creating a Domain-Specific Language Solution

Defining Diagram Elements

How to: Add a Geometry Shape (DSL Explorer)

Domain-Specific Language Tools Glossary