Shapes can contain - and be composed of - other shapes.

Subshape Layout:

To set the layout type, the layoutType attribute must be set in the initialization attributes section of the script; in other words, before any of the methods are called. Valid values for this attribute are:

LeftRight - Shapes with leftright layout position subshapes side by side, with the first added on the left, and subsequent subshapes to the right
TopDown - TopDown places subshapes in a vertical arrangement, with the first shape added to the top and subsequent shapes added below
Border - Border layout requires an additional argument to the addsubshape method to specify which region of the containing shape the subshape is to occupy: N, E, S, W or CENTER; each region can only be occupied by one subshape
A subshape that is assigned to the E or W region must have its preferredwidth attribute specified in its declaration and, similarly, subshapes added to N or S must have their preferredheight attribute set; in this case, the values for these attributes are treated as static lengths and do not scale glyphs

For example:

shape main










 shape sub







The above script provides the following shape: