Package org.apache.poi.ss.usermodel

Examples of org.apache.poi.ss.usermodel.ClientAnchor


      
       // Try to add comments to Sheet 1
       CreationHelper factory = wb.getCreationHelper();
       Drawing drawing = sh1.createDrawingPatriarch();

       ClientAnchor anchor = factory.createClientAnchor();
       anchor.setCol1(0);
       anchor.setCol2(4);
       anchor.setRow1(0);
       anchor.setRow2(1);

       Comment comment1 = drawing.createCellComment(anchor);
       comment1.setString(
             factory.createRichTextString("I like this cell. It's my favourite."));
       comment1.setAuthor("Bob T. Fish");
View Full Code Here


      
       // Try to add comments to Sheet 1
       CreationHelper factory = wb.getCreationHelper();
       Drawing drawing = sh1.createDrawingPatriarch();

       ClientAnchor anchor = factory.createClientAnchor();
       anchor.setCol1(0);
       anchor.setCol2(4);
       anchor.setRow1(0);
       anchor.setRow2(1);

       Comment comment1 = drawing.createCellComment(anchor);
       comment1.setString(
             factory.createRichTextString("I like this cell. It's my favourite."));
       comment1.setAuthor("Bob T. Fish");
View Full Code Here

      
       // Try to add comments to Sheet 1
       CreationHelper factory = wb.getCreationHelper();
       Drawing drawing = sh1.createDrawingPatriarch();

       ClientAnchor anchor = factory.createClientAnchor();
       anchor.setCol1(0);
       anchor.setCol2(4);
       anchor.setRow1(0);
       anchor.setRow2(1);

       Comment comment1 = drawing.createCellComment(anchor);
       comment1.setString(
             factory.createRichTextString("I like this cell. It's my favourite."));
       comment1.setAuthor("Bob T. Fish");
View Full Code Here

      
       // Try to add comments to Sheet 1
       CreationHelper factory = wb.getCreationHelper();
       Drawing drawing = sh1.createDrawingPatriarch();

       ClientAnchor anchor = factory.createClientAnchor();
       anchor.setCol1(0);
       anchor.setCol2(4);
       anchor.setRow1(0);
       anchor.setRow2(1);

       Comment comment1 = drawing.createCellComment(anchor);
       comment1.setString(
             factory.createRichTextString("I like this cell. It's my favourite."));
       comment1.setAuthor("Bob T. Fish");
View Full Code Here

        HSSFSheet sheet = wb.createSheet();
        HSSFPatriarch patriarch = sheet.createDrawingPatriarch();
        CreationHelper ch = wb.getCreationHelper();

        ClientAnchor anchor = ch.createClientAnchor();
        anchor.setCol1(2);
        anchor.setCol2(5);
        anchor.setRow1(1);
        anchor.setRow2(6);
        patriarch.createPicture(anchor, indexEmf);
       
        anchor = ch.createClientAnchor();
        anchor.setCol1(2);
        anchor.setCol2(5);
        anchor.setRow1(10);
        anchor.setRow2(16);
        patriarch.createPicture(anchor, indexPng);

        anchor = ch.createClientAnchor();
        anchor.setCol1(6);
        anchor.setCol2(9);
        anchor.setRow1(1);
        anchor.setRow2(6);
        patriarch.createPicture(anchor, indexWmf);
       
       
        wb = HSSFTestDataSamples.writeOutAndReadBack(wb);
        byte pictureDataOut[] = wb.getAllPictures().get(0).getData();
View Full Code Here

      
       // Try to add comments to Sheet 1
       CreationHelper factory = wb.getCreationHelper();
       Drawing drawing = sh1.createDrawingPatriarch();

       ClientAnchor anchor = factory.createClientAnchor();
       anchor.setCol1(0);
       anchor.setCol2(4);
       anchor.setRow1(0);
       anchor.setRow2(1);

       Comment comment1 = drawing.createCellComment(anchor);
       comment1.setString(
             factory.createRichTextString("I like this cell. It's my favourite."));
       comment1.setAuthor("Bob T. Fish");
View Full Code Here

        HSSFSheet sheet = wb.createSheet();
        HSSFPatriarch patriarch = sheet.createDrawingPatriarch();
        CreationHelper ch = wb.getCreationHelper();

        ClientAnchor anchor = ch.createClientAnchor();
        anchor.setCol1(2);
        anchor.setCol2(5);
        anchor.setRow1(1);
        anchor.setRow2(6);
        patriarch.createPicture(anchor, indexEmf);
       
        anchor = ch.createClientAnchor();
        anchor.setCol1(2);
        anchor.setCol2(5);
        anchor.setRow1(10);
        anchor.setRow2(16);
        patriarch.createPicture(anchor, indexPng);

        anchor = ch.createClientAnchor();
        anchor.setCol1(6);
        anchor.setCol2(9);
        anchor.setRow1(1);
        anchor.setRow2(6);
        patriarch.createPicture(anchor, indexWmf);
       
       
        wb = HSSFTestDataSamples.writeOutAndReadBack(wb);
        byte pictureDataOut[] = wb.getAllPictures().get(0).getData();
View Full Code Here

    public void testOneSeriePlot() throws Exception {
        Workbook wb = new XSSFWorkbook();
        Sheet sheet = new SheetBuilder(wb, plotData).build();
        Drawing drawing = sheet.createDrawingPatriarch();
        ClientAnchor anchor = drawing.createAnchor(0, 0, 0, 0, 1, 1, 10, 30);
        Chart chart = drawing.createChart(anchor);

        ChartAxis bottomAxis = chart.getChartAxisFactory().createCategoryAxis(AxisPosition.BOTTOM);
        ChartAxis leftAxis = chart.getChartAxisFactory().createValueAxis(AxisPosition.LEFT);
View Full Code Here

      
       // Try to add comments to Sheet 1
       CreationHelper factory = wb.getCreationHelper();
       Drawing drawing = sh1.createDrawingPatriarch();

       ClientAnchor anchor = factory.createClientAnchor();
       anchor.setCol1(0);
       anchor.setCol2(4);
       anchor.setRow1(0);
       anchor.setRow2(1);

       Comment comment1 = drawing.createCellComment(anchor);
       comment1.setString(
             factory.createRichTextString("I like this cell. It's my favourite."));
       comment1.setAuthor("Bob T. Fish");
View Full Code Here

        return this;
    }

    private void addAllCommentsToOneCell(Drawing drawing, CreationHelper factory, Cell c, String... texts) {
        ClientAnchor anchor = factory.createClientAnchor();
//        System.out.println("a"+c.toString());
//        System.out.println("a"+c.getColumnIndex());
//        System.out.println("a"+c.getRowIndex());
//        System.out.println("_____________________"+c);

        int commentLines = 0;
        for (int i = 0; i < texts.length; ++i) {
            commentLines += 1;
            commentLines += texts[i].length() - texts[i].replace("\n","").length();
        }

        anchor.setCol1(c.getColumnIndex());
        anchor.setCol2(c.getColumnIndex() + 7);
        anchor.setRow1(c.getRowIndex());
        anchor.setRow2(c.getRowIndex() + commentLines);

        // Create the comment and set the text+author
        Comment comment = drawing.createCellComment(anchor);
        StringBuilder sb = new StringBuilder();
        String separator = "";
View Full Code Here

TOP

Related Classes of org.apache.poi.ss.usermodel.ClientAnchor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.