Example usage for org.apache.poi.ddf EscherClientAnchorRecord getDx1

List of usage examples for org.apache.poi.ddf EscherClientAnchorRecord getDx1

Introduction

In this page you can find the example usage for org.apache.poi.ddf EscherClientAnchorRecord getDx1.

Prototype

public short getDx1() 

Source Link

Document

The x offset within the top-left cell.

Usage

From source file:com.haulmont.yarg.formatters.impl.xls.HSSFPicturesHelper.java

License:Apache License

public static void searchForAnchors(List escherRecords, List<HSSFClientAnchor> pictures) {
    Iterator recordIter = escherRecords.iterator();
    HSSFClientAnchor anchor = null;//  w w  w.jav  a2s  .  c o  m
    while (recordIter.hasNext()) {
        Object obj = recordIter.next();
        if (obj instanceof EscherRecord) {
            EscherRecord escherRecord = (EscherRecord) obj;
            if (escherRecord instanceof EscherClientAnchorRecord) {
                EscherClientAnchorRecord anchorRecord = (EscherClientAnchorRecord) escherRecord;
                if (anchor == null)
                    anchor = new HSSFClientAnchor();
                anchor.setDx1(anchorRecord.getDx1());
                anchor.setDx2(anchorRecord.getDx2());
                anchor.setDy1(anchorRecord.getDy1());
                anchor.setDy2(anchorRecord.getDy2());
                anchor.setRow1(anchorRecord.getRow1());
                anchor.setRow2(anchorRecord.getRow2());
                anchor.setCol1(anchorRecord.getCol1());
                anchor.setCol2(anchorRecord.getCol2());
            }
            // Recursive call.
            searchForAnchors(escherRecord.getChildRecords(), pictures);
        }
    }
    if (anchor != null)
        pictures.add(anchor);
}