Developer Wiki

In-depth guide for developers to create stencils and templates

Your First Shape

Let's begin with a collection contains a simple shape that provide a text Hello World. This shape contains Properties definition, elements definition in the Content section and the behaviors that make content changed to property values.

<?xml version="1.0" encoding="UTF-8"?>
    <Shapes xmlns=""
            id="collection" displayName="My Collection"
            description="My First Collection" author="author">
      <Shape id="helloworld" displayName="Hello World"
          <PropertyGroup name="Text">
            <Property name="label" displayName="Label" 
                      type="PlainText">Hello World</Property>
            <Property name="textColor" displayName="Color"
            <Property name="textFont"
          <For ref="text">
              <Arg>new Bound(0, 0, 100, 12)</Arg>
              <Arg>new Alignment(0, 1)</Arg>
        <p:Content xmlns:p=""
          <text id="text" />

Each child node in <For></For> is an behavior that defines how content should be changed according to the properties. More details about can be found at the Behavior Reference.

The $label variable is used in the TextContent behavior in this example shows you the way properties can be referenced in the input arguments for behaviors.