List of usage examples for org.apache.poi.hssf.usermodel HSSFClientAnchor getCol2
public short getCol2()
From source file:com.haulmont.yarg.formatters.impl.XLSFormatter.java
License:Apache License
/** * Copies all pictures from template sheet to result sheet, shift picture depending on area dependencies * * @param templateSheet - template sheet * @param resultSheet - result sheet//from w w w . j a va 2 s. c o m */ protected void copyPicturesFromTemplateToResult(HSSFSheet templateSheet, HSSFSheet resultSheet) { List<HSSFClientAnchor> list = getAllAnchors(getEscherAggregate(templateSheet)); int i = 0; if (CollectionUtils.isNotEmpty(orderedPicturesId)) {//just a shitty workaround for anchors without pictures for (HSSFClientAnchor anchor : list) { Cell topLeft = getCellFromTemplate(new Cell(anchor.getCol1(), anchor.getRow1())); anchor.setCol1(topLeft.getCol()); anchor.setRow1(topLeft.getRow()); anchor.setCol2(topLeft.getCol() + anchor.getCol2() - anchor.getCol1()); anchor.setRow2(topLeft.getRow() + anchor.getRow2() - anchor.getRow1()); HSSFPatriarch sheetPatriarch = drawingPatriarchsMap.get(resultSheet); if (sheetPatriarch != null) { sheetPatriarch.createPicture(anchor, orderedPicturesId.get(i++)); } } } }