Package org.apache.poi.hssf.usermodel

Examples of org.apache.poi.hssf.usermodel.HSSFClientAnchor


        // Could be a group, or a base object
        if(shapeContainer.getChildRecords().size() == 1 &&
            shapeContainer.getChildContainers().size() == 1) {
          // Group
          HSSFShapeGroup group =
            new HSSFShapeGroup(null, new HSSFClientAnchor());
          patriarch.getChildren().add(group);
         
          EscherContainerRecord groupContainer =
            (EscherContainerRecord)shapeContainer.getChild(0);
          convertRecordsToUserModel(groupContainer, group);
        } else if(shapeContainer.hasChildOfType((short)0xF00D)) {
          // TextBox
          HSSFTextbox box =
            new HSSFTextbox(null, new HSSFClientAnchor());
          patriarch.getChildren().add(box);
         
          convertRecordsToUserModel(shapeContainer, box);
        } else if(shapeContainer.hasChildOfType((short)0xF011)) {
          // Not yet supporting EscherClientDataRecord stuff
View Full Code Here


{
    public static EscherRecord createAnchor( HSSFAnchor userAnchor )
    {
        if (userAnchor instanceof HSSFClientAnchor)
        {
            HSSFClientAnchor a = (HSSFClientAnchor) userAnchor;

            EscherClientAnchorRecord anchor = new EscherClientAnchorRecord();
            anchor.setRecordId( EscherClientAnchorRecord.RECORD_ID );
            anchor.setOptions( (short) 0x0000 );
            anchor.setFlag( (short) 0 );
            anchor.setCol1( (short) Math.min(a.getCol1(), a.getCol2()) );
            anchor.setDx1( (short) Math.min(a.getDx1(), a.getDx2()) );
            anchor.setRow1( (short) Math.min(a.getRow1(), a.getRow2()) );
            anchor.setDy1( (short) Math.min(a.getDy1(), a.getDy2()) );

            anchor.setCol2( (short) Math.max(a.getCol1(), a.getCol2()) );
            anchor.setDx2( (short) Math.max(a.getDx1(), a.getDx2()) );
            anchor.setRow2( (short) Math.max(a.getRow1(), a.getRow2()) );
            anchor.setDy2( (short) Math.max(a.getDy1(), a.getDy2() ) );
            return anchor;
        }
        else
        {
            HSSFChildAnchor a = (HSSFChildAnchor) userAnchor;
            EscherChildAnchorRecord anchor = new EscherChildAnchorRecord();
            anchor.setRecordId( EscherChildAnchorRecord.RECORD_ID );
            anchor.setOptions( (short) 0x0000 );
            anchor.setDx1( (short) Math.min(a.getDx1(), a.getDx2()) );
            anchor.setDy1( (short) Math.min(a.getDy1(), a.getDy2()) );
            anchor.setDx2( (short) Math.max(a.getDx2(), a.getDx1()) );
            anchor.setDy2( (short) Math.max(a.getDy2(), a.getDy1()) );
            return anchor;
        }
    }
View Full Code Here

      short column = (short) image.getColumn();
      int width = Math.abs(image.getWidth());
      int height = Math.abs(image.getHeight());

      int index = workbook.addPicture(bytes, type);
      HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 0, 0, row, column, row, column);

      HSSFPatriarch patriarch = s.createDrawingPatriarch();
      HSSFPicture picture = patriarch.createPicture(anchor, index);

      picture.resize();
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.usermodel.HSSFClientAnchor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.