}
if(!isClosed) segInfo.add(SEGMENTINFO_LINETO);
segInfo.add(new byte[]{0x00, (byte)0x80});
EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.GEOMETRY__SHAPEPATH, 0x4));
EscherArrayProperty verticesProp = new EscherArrayProperty((short)(EscherProperties.GEOMETRY__VERTICES + 0x4000), false, null);
verticesProp.setNumberOfElementsInArray(pntInfo.size());
verticesProp.setNumberOfElementsInMemory(pntInfo.size());
verticesProp.setSizeOfElements(0xFFF0);
for (int i = 0; i < pntInfo.size(); i++) {
Point2D.Double pnt = pntInfo.get(i);
byte[] data = new byte[4];
LittleEndian.putShort(data, 0, (short)((pnt.getX() - bounds.getX())*MASTER_DPI/POINT_DPI));
LittleEndian.putShort(data, 2, (short)((pnt.getY() - bounds.getY())*MASTER_DPI/POINT_DPI));
verticesProp.setElement(i, data);
}
opt.addEscherProperty(verticesProp);
EscherArrayProperty segmentsProp = new EscherArrayProperty((short)(EscherProperties.GEOMETRY__SEGMENTINFO + 0x4000), false, null);
segmentsProp.setNumberOfElementsInArray(segInfo.size());
segmentsProp.setNumberOfElementsInMemory(segInfo.size());
segmentsProp.setSizeOfElements(0x2);
for (int i = 0; i < segInfo.size(); i++) {
byte[] seg = segInfo.get(i);
segmentsProp.setElement(i, seg);
}
opt.addEscherProperty(segmentsProp);
opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.GEOMETRY__RIGHT, (int)(bounds.getWidth()*MASTER_DPI/POINT_DPI)));
opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.GEOMETRY__BOTTOM, (int)(bounds.getHeight()*MASTER_DPI/POINT_DPI)));
opt.sortProperties();
setAnchor(bounds);
}