List of usage examples for org.apache.poi.xssf.usermodel XSSFSheet showInPane
@Override public void showInPane(int toprow, int leftcol)
From source file:org.keyboardplaying.xtt.xlsx.XlsxNormalizer.java
License:Apache License
private void normalizeSheet(XSSFSheet sheet, String activeRange) { sheet.setZoom(ZOOM_100);// w w w . j a va 2s. c o m sheet.setDisplayGridlines(false); sheet.setSelected(false); PaneInformation pane = sheet.getPaneInformation(); if (pane == null) { /* Reset cell */ sheet.setActiveCell(new CellAddress(activeRange)); /* Reset view */ sheet.getCTWorksheet().getSheetViews().getSheetViewArray(0) .setTopLeftCell(CellAddress.A1.formatAsString()); } else { /* Reset cell */ sheet.createFreezePane(0, 0); // Remove panes sheet.setActiveCell(new CellAddress(activeRange)); sheet.createFreezePane(pane.getVerticalSplitLeftColumn(), pane.getHorizontalSplitTopRow()); // Reset panes /* Reset view */ sheet.showInPane(pane.getHorizontalSplitPosition(), pane.getVerticalSplitPosition()); } }