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

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

Introduction

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

Prototype

public short getCol1() 

Source Link

Document

The column number for the top-left position.

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;/*from w ww  . java  2  s  .co 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);
}