Package org.apache.poi.ss.usermodel

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


       // Sheet 1 doesn't (yet)
       assertNull(sh1.getCommentsTable(false));
      
       // 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");
      
       Comment comment2 = drawing.createCellComment(anchor);
       comment2.setString(
             factory.createRichTextString("This is much less fun..."));
       comment2.setAuthor("Bob T. Fish");

       Cell c1 = sh1.getRow(0).createCell(4);
View Full Code Here


        anchor.setCol1(cell.getColumnIndex());
        anchor.setCol2(cell.getColumnIndex()+1);
        anchor.setRow1(row.getRowNum());
        anchor.setRow2(row.getRowNum()+3);
       
        Drawing drawing = sheet.createDrawingPatriarch();
        Comment comment1 = drawing.createCellComment(anchor);
       
        RichTextString commentRtf = creationHelper.createRichTextString(commentText);
       
        comment1.setString(commentRtf);
        Comment comment = comment1;
View Full Code Here

       // Sheet 1 doesn't (yet)
       assertNull(sh1.getCommentsTable(false));
      
       // 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");
      
       Comment comment2 = drawing.createCellComment(anchor);
       comment2.setString(
             factory.createRichTextString("This is much less fun..."));
       comment2.setAuthor("Bob T. Fish");

       Cell c1 = sh1.getRow(0).createCell(4);
View Full Code Here

   * @param workbook
   */
  private static void addDataToSheet(TemplateExportParams params,
      Class<?> pojoClass, Collection<?> dataSet, Sheet sheet,
      Workbook workbook) throws Exception {
    Drawing patriarch = sheet.createDrawingPatriarch();
    List<ExcelExportEntity> excelParams = new ArrayList<ExcelExportEntity>();
    // 得到所有字段
    Field fileds[] = ExcelPublicUtil.getClassFields(pojoClass);
    ExcelTarget etarget = pojoClass.getAnnotation(ExcelTarget.class);
    String targetId = null;
View Full Code Here

      ExcelTitle entity, Class<?> pojoClass, Collection<?> dataSet) {
    try {
      Sheet sheet = workbook.createSheet(entity.getSheetName());
      //创建表格属性
      Map<String,HSSFCellStyle> styles = createStyles(workbook);
      Drawing patriarch = sheet.createDrawingPatriarch();
      List<ExcelExportEntity> excelParams = new ArrayList<ExcelExportEntity>();
      // 得到所有字段
      Field fileds[] = ExcelPublicUtil.getClassFields(pojoClass);
      ExcelTarget etarget = pojoClass.getAnnotation(ExcelTarget.class);
      String targetId = null;
View Full Code Here

       // Sheet 1 doesn't (yet)
       assertNull(sh1.getCommentsTable(false));
      
       // 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");
      
       anchor = factory.createClientAnchor();
       anchor.setCol1(0);
       anchor.setCol2(4);
       anchor.setRow1(1);
       anchor.setRow2(1);
       Comment comment2 = drawing.createCellComment(anchor);
       comment2.setString(
             factory.createRichTextString("This is much less fun..."));
       comment2.setAuthor("Bob T. Fish");

       Cell c1 = sh1.getRow(0).createCell(4);
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().createValueAxis(AxisPosition.BOTTOM);
        ChartAxis leftAxis = chart.getChartAxisFactory().createValueAxis(AxisPosition.LEFT);

        ScatterChartData scatterChartData =
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);

        LineChartData lineChartData =
View Full Code Here

                cell = row.createCell((short) colIndex);
                cell.setCellValue(colIndex * (rowIndex + 1));
            }
        }

        Drawing drawing = sheet.createDrawingPatriarch();
        ClientAnchor anchor = drawing.createAnchor(0, 0, 0, 0, 0, 5, 10, 15);

        Chart chart = drawing.createChart(anchor);
        ChartLegend legend = chart.getOrCreateLegend();
        legend.setPosition(LegendPosition.TOP_RIGHT);

        LineChartData data = chart.getChartDataFactory().createLineChartData();

View Full Code Here

TOP

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

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.