Hi,
This defines a rectangular shape where the text is displayed below the rectangle:
Shape sp = new Shape(
new ElementTemplate[]
{
new LineTemplate(0,0,0,100),
new LineTemplate(0,100, 100, 100),
new LineTemplate(100, 100, 100, 0),
new LineTemplate(100, 0, 0, 0)
},
null,
new ElementTemplate[]
{
new LineTemplate(0,110, 100,110),
new LineTemplate(100,110, 100, 200),
new LineTemplate(100, 200, 0,200),
new LineTemplate(0, 200, 0, 110 )
}, 0, "newShape");
diagram.setDefaultShape(sp);
The attachTo argument specifies a corner to which the attached node should be anchored. It is not aligned to that corner, but the group preserves the original distance from the child node to that corner.
I hope that helps,
Stoyan