use of org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D in project poi by apache.
the class XSLFSimpleShape method getAnchor.
@Override
public Rectangle2D getAnchor() {
CTTransform2D xfrm = getXfrm(false);
if (xfrm == null) {
return null;
}
CTPoint2D off = xfrm.getOff();
double x = Units.toPoints(off.getX());
double y = Units.toPoints(off.getY());
CTPositiveSize2D ext = xfrm.getExt();
double cx = Units.toPoints(ext.getCx());
double cy = Units.toPoints(ext.getCy());
return new Rectangle2D.Double(x, y, cx, cy);
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D in project poi by apache.
the class XSLFGraphicFrame method setAnchor.
@Override
public void setAnchor(Rectangle2D anchor) {
CTTransform2D xfrm = ((CTGraphicalObjectFrame) getXmlObject()).getXfrm();
CTPoint2D off = xfrm.isSetOff() ? xfrm.getOff() : xfrm.addNewOff();
long x = Units.toEMU(anchor.getX());
long y = Units.toEMU(anchor.getY());
off.setX(x);
off.setY(y);
CTPositiveSize2D ext = xfrm.isSetExt() ? xfrm.getExt() : xfrm.addNewExt();
long cx = Units.toEMU(anchor.getWidth());
long cy = Units.toEMU(anchor.getHeight());
ext.setCx(cx);
ext.setCy(cy);
}
Aggregations