// This sample illustrates how to define
  // a custom node shape via the Shape class

  // Create a new shape object
  Shape shape = new Shape(
    new ElementTemplate[]
    {
      new ArcTemplate(001001000360)
    },
    new ElementTemplate[]
    {
      new ArcTemplate(25301515180180),
      new ArcTemplate(60301515180180),
      new ArcTemplate(306040150180)
    },
    null,
    java.awt.geom.GeneralPath.WIND_NON_ZERO,
    "Happy");

  // Create a node and assign the shape to it
  ShapeNode node = diagram.getFactory().createShapeNode(101010080);
  node.setShape(Shape.fromId("Happy"));