{
// here comes the magic - we transform the line into the absolute space;
// this should preserve the general appearance. Heck, and if not, then
// it is part of the users responsibility to resolve that. Magic does not
// solve all problems, you know.
final Line2D line = new Line2D.Float
(Math.abs(x1), Math.abs(y1), Math.abs(x2), Math.abs(y2));
final Rectangle2D shapeBounds = line.getBounds2D();
final Shape transformedShape =
ShapeTransform.translateShape(line, -shapeBounds.getX(), -shapeBounds.getY());
// and use that shape with the user's bounds to create the element.
final ContentElementFactory elementFactory = new ContentElementFactory();
elementFactory.setName(name);