Share via


How to: Add a Geometry Shape (DSL Explorer)

You can use geometry shapes to specify how domain classes appear in a generated designer (for example, what fill color and text color it will display). For more information, see Geometry Shape (Domain-Specific Language Designer).

Note

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

After you create and customize 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, How to: Add a Shape Map (DSL Explorer), and How to: Map Elements By Using the Diagram Element Map Tool.

To add a geometry shape to a domain-specific language definition by using DSL Explorer, use the steps in the following procedure.

To add a geometry shape by using DSL Explorer

  1. In DSL Explorer, right-click the Dsl node, and click Add New Geometry Shape.

    A geometry shape that is named GeometryShape1 appears in the Diagram Elements swimlane.

  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 more information, see How to: Add a Domain Property.

  4. In the Properties window, set any properties. For example, you can change the default value of the FillColor propertyfrom white to yellow and the Geometry property from rectangle to circle.

    After you create and customize a geometry shape, you must map it to the domain class or the named domain class by using the Diagram Element Map tool or the Diagram node in DSL Explorer. For more information, see How to: Map Elements By Using the Diagram Element Map Tool or How to: Add a Shape Map (DSL Explorer). Next, you create an ElementTool item for the Toolbox by using DSL Explorer. For more information, see How to: Add an Element Tool.

    You can now click Transform All Templates in Solution Explorer and start a Visual Studio experimental build to verify that 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 to a Domain-Specific Language Definition

Domain-Specific Language Tools Glossary