Example usage for org.apache.poi.ss.usermodel Sheet PANE_LOWER_LEFT

List of usage examples for org.apache.poi.ss.usermodel Sheet PANE_LOWER_LEFT

Introduction

In this page you can find the example usage for org.apache.poi.ss.usermodel Sheet PANE_LOWER_LEFT.

Prototype

byte PANE_LOWER_LEFT

To view the source code for org.apache.poi.ss.usermodel Sheet PANE_LOWER_LEFT.

Click Source Link

Usage

From source file:featurescomparison.workingwithcellsrowscolumns.splitpanes.java.ApacheSplitPanes.java

License:Apache License

public static void main(String[] args) throws Exception {
    String dataPath = "src/featurescomparison/workingwithcellsrowscolumns/splitpanes/data/";

    Workbook wb = new XSSFWorkbook();
    Sheet sheet = wb.createSheet("new sheet");

    // Create a split with the lower left side being the active quadrant
    sheet.createSplitPane(2000, 2000, 0, 0, Sheet.PANE_LOWER_LEFT);

    FileOutputStream fileOut = new FileOutputStream(dataPath + "ApacheSplitFreezePanes.xlsx");
    wb.write(fileOut);/*from   w  w  w  .j  av  a2 s.co m*/
    fileOut.close();
    System.out.println("Done.");
}

From source file:org.alanwilliamson.openbd.plugin.spreadsheet.functions.SpreadsheetAddSplitPane.java

License:Open Source License

public cfData execute(cfSession _session, List<cfData> parameters) throws cfmRunTimeException {
    cfSpreadSheetData spreadsheet = null;

    int xSplitPos = 0;
    int ySplitPos = 0;
    int leftmostColumn = 0;
    int topRow = 0;
    int activePane = Sheet.PANE_LOWER_LEFT;

    /*/*from   ww  w .j a  v a2  s .c  om*/
     * Collect up the parameters
     */
    if (parameters.size() == 5) {
        spreadsheet = (cfSpreadSheetData) parameters.get(4);
        xSplitPos = parameters.get(3).getInt();
        ySplitPos = parameters.get(2).getInt();
        leftmostColumn = parameters.get(1).getInt() - 1;
        topRow = parameters.get(0).getInt() - 1;
    } else if (parameters.size() == 6) {
        spreadsheet = (cfSpreadSheetData) parameters.get(5);
        xSplitPos = parameters.get(4).getInt();
        ySplitPos = parameters.get(3).getInt();
        leftmostColumn = parameters.get(2).getInt() - 1;
        topRow = parameters.get(1).getInt() - 1;
        activePane = getActivePane(parameters.get(0).getString());
    }

    if (leftmostColumn < 0)
        throwException(_session, "leftmostColumn must be 1 or greater (" + leftmostColumn + ")");
    if (topRow < 0)
        throwException(_session, "topRow must be 1 or greater (" + topRow + ")");

    //Perform the split operation
    spreadsheet.getActiveSheet().createSplitPane(xSplitPos, ySplitPos, leftmostColumn, topRow, activePane);

    return cfBooleanData.TRUE;
}

From source file:org.alanwilliamson.openbd.plugin.spreadsheet.functions.SpreadsheetAddSplitPane.java

License:Open Source License

private int getActivePane(String pane) {
    pane = pane.toUpperCase();/*from w  w w .  j  a  v  a2s .co  m*/
    if (pane.equals("PANE_LOWER_RIGHT"))
        return Sheet.PANE_LOWER_RIGHT;
    else if (pane.equals("PANE_LOWER_LEFT"))
        return Sheet.PANE_LOWER_LEFT;
    else if (pane.equals("PANE_UPPER_RIGHT"))
        return Sheet.PANE_UPPER_RIGHT;
    else if (pane.equals("PANE_LOWER_RIGHT"))
        return Sheet.PANE_LOWER_RIGHT;
    else
        return Sheet.PANE_LOWER_LEFT;
}

From source file:packtest.SplitAndFreezePanes.java

License:Apache License

public static void main(String[] args) throws Exception {
    Workbook wb = new XSSFWorkbook();
    Sheet sheet1 = wb.createSheet("new sheet");
    Sheet sheet2 = wb.createSheet("second sheet");
    Sheet sheet3 = wb.createSheet("third sheet");
    Sheet sheet4 = wb.createSheet("fourth sheet");

    // Freeze just one row
    sheet1.createFreezePane(0, 1, 0, 1);
    // Freeze just one column
    sheet2.createFreezePane(1, 0, 1, 0);
    // Freeze the columns and rows (forget about scrolling position of the lower right quadrant).
    sheet3.createFreezePane(2, 2);/*from   www  .jav  a2s.  c o  m*/
    // Create a split with the lower left side being the active quadrant
    sheet4.createSplitPane(2000, 2000, 0, 0, Sheet.PANE_LOWER_LEFT);

    FileOutputStream fileOut = new FileOutputStream("splitFreezePane.xlsx");
    wb.write(fileOut);
    fileOut.close();
}