final int lastElementIdx = reportElements.size() - 1;
final Element lastElement = reportElements.get(lastElementIdx);
final Element firstElement = reportElements.get(0);
final CachedLayoutData firstLayoutData = ModelUtility.getCachedLayoutData(firstElement);
final CachedLayoutData lastLayoutData = ModelUtility.getCachedLayoutData(lastElement);
final long height = (lastLayoutData.getX() + lastLayoutData.getWidth()) -
(firstLayoutData.getX() + firstLayoutData.getWidth());
final long incr = height / lastElementIdx;
long currentY = firstLayoutData.getX() + firstLayoutData.getWidth();
currentY += incr;//start from second element
for (Element reportElement : reportElements)
{
final CachedLayoutData layoutData = ModelUtility.getCachedLayoutData(reportElement);
final long delta = currentY - layoutData.getWidth();
if (delta == 0)
{
continue;
}
carrier[0] = reportElement;
final Point2D.Double originPoint = new Point2D.Double(StrictGeomUtility.toExternalValue(layoutData.getX()), 0);
final MoveDragOperation mop = new MoveDragOperation
(Arrays.asList(carrier), originPoint, EmptySnapModel.INSTANCE, EmptySnapModel.INSTANCE);
mop.update(new Point2D.Double(StrictGeomUtility.toExternalValue(delta), 0), 1);
mop.finish();