private Polygon createPolygon(Project project, Animation animation) {
    java.awt.Polygon shape = (java.awt.Polygon) animation.getShape(0);
    Polygon p = activaMpeg7Factory.createRegionLocatorTypePolygon();

    IntegerMatrixType value = activaMpeg7Factory.createIntegerMatrixType();
    value.getDim().add(BigInteger.valueOf(2));
    value.getDim().add(BigInteger.valueOf(shape.npoints));

    for (int i = 1; i < shape.npoints; i++) {
      value.getValue().add(BigInteger.valueOf(shape.xpoints[i]));
      value.getValue().add(BigInteger.valueOf(shape.ypoints[i]));
    }
    p.setCoords(value);

    return p;
  }
  private Box createBox(Project project, Animation animation) {
    java.awt.Rectangle shape = (java.awt.Rectangle) animation.getShape(0);
    Box b = activaMpeg7Factory.createRegionLocatorTypeBox();

    b.getDim().add(BigInteger.valueOf(2));
    b.getDim().add(BigInteger.valueOf(4));

    b.getValue().add(BigInteger.valueOf(shape.x));
    b.getValue().add(BigInteger.valueOf(shape.y));

    b.getValue().add(BigInteger.valueOf(shape.x + shape.width));
    b.getValue().add(BigInteger.valueOf(shape.y));

    b.getValue().add(BigInteger.valueOf(shape.x));
    b.getValue().add(BigInteger.valueOf(shape.y + shape.height));

    b.getValue().add(BigInteger.valueOf(shape.x + shape.width));
    b.getValue().add(BigInteger.valueOf(shape.y + shape.height));

    return b;
  }