Examples of EscherSpgrRecord


Examples of org.apache.poi.ddf.EscherSpgrRecord

    // First up, get the patriach position
    // This is in the first EscherSpgrRecord, in
    //  the first container, with a EscherSRecord too
    EscherContainerRecord patriachContainer =
      (EscherContainerRecord)tcc.get(0);
    EscherSpgrRecord spgr = null;
    for(Iterator<EscherRecord> it = patriachContainer.getChildIterator(); it.hasNext();) {
      EscherRecord r = it.next();
      if(r instanceof EscherSpgrRecord) {
        spgr = (EscherSpgrRecord)r;
        break;
      }
    }
    if(spgr != null) {
      patriarch.setCoordinates(
          spgr.getRectX1(), spgr.getRectY1(),
          spgr.getRectX2(), spgr.getRectY2()
      );
    }
   
    // Now process the containers for each group
    //  and objects
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpgrRecord

  private void convertRecordsToUserModel(EscherContainerRecord shapeContainer, Object model) {
    for(Iterator<EscherRecord> it = shapeContainer.getChildIterator(); it.hasNext();) {
      EscherRecord r = it.next();
      if(r instanceof EscherSpgrRecord) {
        // This may be overriden by a later EscherClientAnchorRecord
        EscherSpgrRecord spgr = (EscherSpgrRecord)r;
       
        if(model instanceof HSSFShapeGroup) {
          HSSFShapeGroup g = (HSSFShapeGroup)model;
          g.setCoordinates(
              spgr.getRectX1(), spgr.getRectY1(),
              spgr.getRectX2(), spgr.getRectY2()
          );
        } else {
          throw new IllegalStateException("Got top level anchor but not processing a group");
        }
      }
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpgrRecord

  private void convertGroup( HSSFShapeGroup shape, EscherContainerRecord escherParent, Map shapeToObj )
  {
    EscherContainerRecord spgrContainer = new EscherContainerRecord();
    EscherContainerRecord spContainer = new EscherContainerRecord();
    EscherSpgrRecord spgr = new EscherSpgrRecord();
    EscherSpRecord sp = new EscherSpRecord();
    EscherOptRecord opt = new EscherOptRecord();
    EscherRecord anchor;
    EscherClientDataRecord clientData = new EscherClientDataRecord();

    spgrContainer.setRecordId( EscherContainerRecord.SPGR_CONTAINER );
    spgrContainer.setOptions( (short) 0x000F );
    spContainer.setRecordId( EscherContainerRecord.SP_CONTAINER );
    spContainer.setOptions( (short) 0x000F );
    spgr.setRecordId( EscherSpgrRecord.RECORD_ID );
    spgr.setOptions( (short) 0x0001 );
    spgr.setRectX1( shape.getX1() );
    spgr.setRectY1( shape.getY1() );
    spgr.setRectX2( shape.getX2() );
    spgr.setRectY2( shape.getY2() );
    sp.setRecordId( EscherSpRecord.RECORD_ID );
    sp.setOptions( (short) 0x0002 );
    int shapeId = drawingManager.allocateShapeId(drawingGroupId);
    sp.setShapeId( shapeId );
    if (shape.getAnchor() instanceof HSSFClientAnchor)
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpgrRecord

  {
    EscherContainerRecord dgContainer = new EscherContainerRecord();
    EscherDgRecord dg;
    EscherContainerRecord spgrContainer = new EscherContainerRecord();
    EscherContainerRecord spContainer1 = new EscherContainerRecord();
    EscherSpgrRecord spgr = new EscherSpgrRecord();
    EscherSpRecord sp1 = new EscherSpRecord();

    dgContainer.setRecordId( EscherContainerRecord.DG_CONTAINER );
    dgContainer.setOptions( (short) 0x000F );
    dg = drawingManager.createDgRecord();
    drawingGroupId = dg.getDrawingGroupId();
//    dg.setOptions( (short) ( drawingId << 4 ) );
//    dg.setNumShapes( getNumberOfShapes( patriarch ) );
//    dg.setLastMSOSPID( 0 );  // populated after all shape id's are assigned.
    spgrContainer.setRecordId( EscherContainerRecord.SPGR_CONTAINER );
    spgrContainer.setOptions( (short) 0x000F );
    spContainer1.setRecordId( EscherContainerRecord.SP_CONTAINER );
    spContainer1.setOptions( (short) 0x000F );
    spgr.setRecordId( EscherSpgrRecord.RECORD_ID );
    spgr.setOptions( (short) 0x0001 )// version
    spgr.setRectX1( patriarch.getX1() );
    spgr.setRectY1( patriarch.getY1() );
    spgr.setRectX2( patriarch.getX2() );
    spgr.setRectY2( patriarch.getY2() );
    sp1.setRecordId( EscherSpRecord.RECORD_ID );
    sp1.setOptions( (short) 0x0002 );
    sp1.setShapeId( drawingManager.allocateShapeId(dg.getDrawingGroupId()) );
    sp1.setFlags( EscherSpRecord.FLAG_GROUP | EscherSpRecord.FLAG_PATRIARCH );
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpgrRecord

    // First up, get the patriach position
    // This is in the first EscherSpgrRecord, in
    //  the first container, with a EscherSRecord too
    EscherContainerRecord patriachContainer =
      (EscherContainerRecord)tcc.get(0);
    EscherSpgrRecord spgr = null;
    for(Iterator<EscherRecord> it = patriachContainer.getChildIterator(); it.hasNext();) {
      EscherRecord r = it.next();
      if(r instanceof EscherSpgrRecord) {
        spgr = (EscherSpgrRecord)r;
        break;
      }
    }
    if(spgr != null) {
      patriarch.setCoordinates(
          spgr.getRectX1(), spgr.getRectY1(),
          spgr.getRectX2(), spgr.getRectY2()
      );
    }

    convertRecordsToUserModelRecursive(tcc, patriarch, null);
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpgrRecord

  private static void convertRecordsToUserModel(EscherContainerRecord shapeContainer, Object model) {
    for(Iterator<EscherRecord> it = shapeContainer.getChildIterator(); it.hasNext();) {
      EscherRecord r = it.next();
      if(r instanceof EscherSpgrRecord) {
        // This may be overriden by a later EscherClientAnchorRecord
        EscherSpgrRecord spgr = (EscherSpgrRecord)r;

        if(model instanceof HSSFShapeGroup) {
          HSSFShapeGroup g = (HSSFShapeGroup)model;
          g.setCoordinates(
              spgr.getRectX1(), spgr.getRectY1(),
              spgr.getRectX2(), spgr.getRectY2()
          );
        } else {
          throw new IllegalStateException("Got top level anchor but not processing a group");
        }
      }
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpgrRecord

  private void convertGroup( HSSFShapeGroup shape, EscherContainerRecord escherParent, Map shapeToObj )
  {
    EscherContainerRecord spgrContainer = new EscherContainerRecord();
    EscherContainerRecord spContainer = new EscherContainerRecord();
    EscherSpgrRecord spgr = new EscherSpgrRecord();
    EscherSpRecord sp = new EscherSpRecord();
    EscherOptRecord opt = new EscherOptRecord();
    EscherRecord anchor;
    EscherClientDataRecord clientData = new EscherClientDataRecord();

    spgrContainer.setRecordId( EscherContainerRecord.SPGR_CONTAINER );
    spgrContainer.setOptions( (short) 0x000F );
    spContainer.setRecordId( EscherContainerRecord.SP_CONTAINER );
    spContainer.setOptions( (short) 0x000F );
    spgr.setRecordId( EscherSpgrRecord.RECORD_ID );
    spgr.setOptions( (short) 0x0001 );
    spgr.setRectX1( shape.getX1() );
    spgr.setRectY1( shape.getY1() );
    spgr.setRectX2( shape.getX2() );
    spgr.setRectY2( shape.getY2() );
    sp.setRecordId( EscherSpRecord.RECORD_ID );
    sp.setOptions( (short) 0x0002 );
    int shapeId = drawingManager.allocateShapeId(drawingGroupId);
    sp.setShapeId( shapeId );
    if (shape.getAnchor() instanceof HSSFClientAnchor)
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpgrRecord

  {
    EscherContainerRecord dgContainer = new EscherContainerRecord();
    EscherDgRecord dg;
    EscherContainerRecord spgrContainer = new EscherContainerRecord();
    EscherContainerRecord spContainer1 = new EscherContainerRecord();
    EscherSpgrRecord spgr = new EscherSpgrRecord();
    EscherSpRecord sp1 = new EscherSpRecord();

    dgContainer.setRecordId( EscherContainerRecord.DG_CONTAINER );
    dgContainer.setOptions( (short) 0x000F );
    dg = drawingManager.createDgRecord();
    drawingGroupId = dg.getDrawingGroupId();
//    dg.setOptions( (short) ( drawingId << 4 ) );
//    dg.setNumShapes( getNumberOfShapes( patriarch ) );
//    dg.setLastMSOSPID( 0 );  // populated after all shape id's are assigned.
    spgrContainer.setRecordId( EscherContainerRecord.SPGR_CONTAINER );
    spgrContainer.setOptions( (short) 0x000F );
    spContainer1.setRecordId( EscherContainerRecord.SP_CONTAINER );
    spContainer1.setOptions( (short) 0x000F );
    spgr.setRecordId( EscherSpgrRecord.RECORD_ID );
    spgr.setOptions( (short) 0x0001 )// version
    spgr.setRectX1( patriarch.getX1() );
    spgr.setRectY1( patriarch.getY1() );
    spgr.setRectX2( patriarch.getX2() );
    spgr.setRectY2( patriarch.getY2() );
    sp1.setRecordId( EscherSpRecord.RECORD_ID );
    sp1.setOptions( (short) 0x0002 );
    sp1.setShapeId( drawingManager.allocateShapeId(dg.getDrawingGroupId()) );
    sp1.setFlags( EscherSpRecord.FLAG_GROUP | EscherSpRecord.FLAG_PATRIARCH );
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpgrRecord

    EscherContainerRecord spContainer = new EscherContainerRecord();
    spContainer.setOptions((short)15);
    spContainer.setRecordId(EscherContainerRecord.SP_CONTAINER);

    EscherSpgrRecord spgr = new EscherSpgrRecord();
    spgr.setOptions((short)1);
    spContainer.addChildRecord(spgr);

    EscherSpRecord sp = new EscherSpRecord();
    sp.setOptions((short)((ShapeTypes.NotPrimitive << 4) + 2));
    sp.setFlags(EscherSpRecord.FLAG_PATRIARCH | EscherSpRecord.FLAG_GROUP);
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpgrRecord

     */
    private void buildBaseTree() {
        EscherContainerRecord dgContainer = new EscherContainerRecord();
        EscherContainerRecord spgrContainer = new EscherContainerRecord();
        EscherContainerRecord spContainer1 = new EscherContainerRecord();
        EscherSpgrRecord spgr = new EscherSpgrRecord();
        EscherSpRecord sp1 = new EscherSpRecord();
        dgContainer.setRecordId(EscherContainerRecord.DG_CONTAINER);
        dgContainer.setOptions((short) 0x000F);
        EscherDgRecord dg = new EscherDgRecord();
        dg.setRecordId(EscherDgRecord.RECORD_ID);
        short dgId = 1;
        dg.setOptions((short) (dgId << 4));
        dg.setNumShapes(0);
        dg.setLastMSOSPID(1024);
        spgrContainer.setRecordId(EscherContainerRecord.SPGR_CONTAINER);
        spgrContainer.setOptions((short) 0x000F);
        spContainer1.setRecordId(EscherContainerRecord.SP_CONTAINER);
        spContainer1.setOptions((short) 0x000F);
        spgr.setRecordId(EscherSpgrRecord.RECORD_ID);
        spgr.setOptions((short) 0x0001);    // version
        spgr.setRectX1(0);
        spgr.setRectY1(0);
        spgr.setRectX2(1023);
        spgr.setRectY2(255);
        sp1.setRecordId(EscherSpRecord.RECORD_ID);

        sp1.setOptions((short) 0x0002);
        sp1.setVersion((short) 0x2);
        sp1.setShapeId(-1);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.