Search in sources :

Example 1 with CTPositiveSize2D

use of org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D in project poi by apache.

the class XSLFGraphicFrame method getAnchor.

@Override
public Rectangle2D getAnchor() {
    CTTransform2D xfrm = ((CTGraphicalObjectFrame) getXmlObject()).getXfrm();
    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);
}
Also used : CTTransform2D(org.openxmlformats.schemas.drawingml.x2006.main.CTTransform2D) CTPoint2D(org.openxmlformats.schemas.drawingml.x2006.main.CTPoint2D) CTGraphicalObjectFrame(org.openxmlformats.schemas.presentationml.x2006.main.CTGraphicalObjectFrame) CTPositiveSize2D(org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D)

Example 2 with CTPositiveSize2D

use of org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D in project poi by apache.

the class XSLFGroupShape method setAnchor.

@Override
public void setAnchor(Rectangle2D anchor) {
    CTGroupTransform2D xfrm = getSafeXfrm();
    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);
}
Also used : CTPoint2D(org.openxmlformats.schemas.drawingml.x2006.main.CTPoint2D) CTGroupTransform2D(org.openxmlformats.schemas.drawingml.x2006.main.CTGroupTransform2D) CTPositiveSize2D(org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D)

Example 3 with CTPositiveSize2D

use of org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D in project poi by apache.

the class XSLFGroupShape method getInteriorAnchor.

/**
     *
     * @return the coordinates of the child extents rectangle
     * used for calculations of grouping, scaling, and rotation
     * behavior of shapes placed within a group.
     */
@Override
public Rectangle2D getInteriorAnchor() {
    CTGroupTransform2D xfrm = getXfrm();
    CTPoint2D off = xfrm.getChOff();
    double x = Units.toPoints(off.getX());
    double y = Units.toPoints(off.getY());
    CTPositiveSize2D ext = xfrm.getChExt();
    double cx = Units.toPoints(ext.getCx());
    double cy = Units.toPoints(ext.getCy());
    return new Rectangle2D.Double(x, y, cx, cy);
}
Also used : CTPoint2D(org.openxmlformats.schemas.drawingml.x2006.main.CTPoint2D) CTGroupTransform2D(org.openxmlformats.schemas.drawingml.x2006.main.CTGroupTransform2D) CTPositiveSize2D(org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D)

Example 4 with CTPositiveSize2D

use of org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D in project poi by apache.

the class XSLFGroupShape method getAnchor.

@Override
public Rectangle2D getAnchor() {
    CTGroupTransform2D xfrm = getXfrm();
    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);
}
Also used : CTPoint2D(org.openxmlformats.schemas.drawingml.x2006.main.CTPoint2D) CTGroupTransform2D(org.openxmlformats.schemas.drawingml.x2006.main.CTGroupTransform2D) CTPositiveSize2D(org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D)

Example 5 with CTPositiveSize2D

use of org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D in project poi by apache.

the class XSLFGroupShape method setInteriorAnchor.

/**
     *
     * @param anchor the coordinates of the child extents rectangle
     * used for calculations of grouping, scaling, and rotation
     * behavior of shapes placed within a group.
     */
@Override
public void setInteriorAnchor(Rectangle2D anchor) {
    CTGroupTransform2D xfrm = getSafeXfrm();
    CTPoint2D off = xfrm.isSetChOff() ? xfrm.getChOff() : xfrm.addNewChOff();
    long x = Units.toEMU(anchor.getX());
    long y = Units.toEMU(anchor.getY());
    off.setX(x);
    off.setY(y);
    CTPositiveSize2D ext = xfrm.isSetChExt() ? xfrm.getChExt() : xfrm.addNewChExt();
    long cx = Units.toEMU(anchor.getWidth());
    long cy = Units.toEMU(anchor.getHeight());
    ext.setCx(cx);
    ext.setCy(cy);
}
Also used : CTPoint2D(org.openxmlformats.schemas.drawingml.x2006.main.CTPoint2D) CTGroupTransform2D(org.openxmlformats.schemas.drawingml.x2006.main.CTGroupTransform2D) CTPositiveSize2D(org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D)

Aggregations

CTPositiveSize2D (org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D)21 CTPoint2D (org.openxmlformats.schemas.drawingml.x2006.main.CTPoint2D)18 CTTransform2D (org.openxmlformats.schemas.drawingml.x2006.main.CTTransform2D)11 CTNonVisualDrawingProps (org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps)8 CTGroupTransform2D (org.openxmlformats.schemas.drawingml.x2006.main.CTGroupTransform2D)7 CTPresetGeometry2D (org.openxmlformats.schemas.drawingml.x2006.main.CTPresetGeometry2D)4 CTShapeProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties)4 Dimension (java.awt.Dimension)2 CTBlipFillProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTBlipFillProperties)2 CTGroupShapeProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTGroupShapeProperties)2 CTNonVisualPictureProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualPictureProperties)2 CTShape (org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape)2 CTShapeNonVisual (org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShapeNonVisual)2 CTInline (org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.CTInline)2 CTGraphicalObjectFrame (org.openxmlformats.schemas.presentationml.x2006.main.CTGraphicalObjectFrame)2 Rectangle2D (java.awt.geom.Rectangle2D)1 FileInputStream (java.io.FileInputStream)1 IOException (java.io.IOException)1 StringReader (java.io.StringReader)1 QName (javax.xml.namespace.QName)1