Ejemplo n.º 1
0
    /**
     * Sets the coordinate space of this group.  All children are constrained
     * to these coordinates.
     *
     * @param anchor the coordinate space of this group
     */
    public void SetCoordinates(Rectangle2D anchor){
        EscherContainerRecord spContainer = (EscherContainerRecord)_escherContainer.GetChild(0);
        EscherSpgrRecord spgr = (EscherSpgrRecord)getEscherChild(spContainer, EscherSpgrRecord.RECORD_ID);

        int x1 = (int)Math.round(anchor.GetX()*MASTER_DPI/POINT_DPI);
        int y1 = (int)Math.round(anchor.GetY()*MASTER_DPI/POINT_DPI);
        int x2 = (int)Math.round((anchor.GetX() + anchor.Width)*MASTER_DPI/POINT_DPI);
        int y2 = (int)Math.round((anchor.GetY() + anchor.Height)*MASTER_DPI/POINT_DPI);

        spgr.SetRectX1(x1);
        spgr.SetRectY1(y1);
        spgr.SetRectX2(x2);
        spgr.SetRectY2(y2);

    }
Ejemplo n.º 2
-31
 /**
  * Auto-shapes are defined in the [0,21600] coordinate system.
  * We need to transform it into normal slide coordinates
  *
 */
 public static java.awt.Shape transform(java.awt.Shape outline, Rectangle2D anchor){
     AffineTransform at = new AffineTransform();
     at.translate(anchor.GetX(), anchor.GetY());
     at.scale(
             1.0f/21600*anchor.Width,
             1.0f/21600*anchor.Height
     );
     return at.CreateTransformedShape(outline);
 }