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

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

Introduction

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

Prototype

public short getRow2() 

Source Link

Document

The row number for the bottom-right corner of the current shape.

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  . j av  a 2s .  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);
}