org.apache.poi.ss.usermodel.Drawing.createAnchor()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(872)

本文整理了Java中org.apache.poi.ss.usermodel.Drawing.createAnchor()方法的一些代码示例,展示了Drawing.createAnchor()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Drawing.createAnchor()方法的具体详情如下:
包路径:org.apache.poi.ss.usermodel.Drawing
类名称:Drawing
方法名:createAnchor

Drawing.createAnchor介绍

[英]Creates a new client anchor and sets the top-left and bottom-right coordinates of the anchor.
[中]创建新的客户端定位,并设置定位的左上角和右下角坐标。

代码示例

代码示例来源:origin: org.jeecg/easypoi-base

/**
 * 构建图形对象
 * @param workbook
 * @param dataSourceSheet
 * @param tragetSheet
 * @param graph
 */
private static void buildExcelChart(Sheet dataSourceSheet,Sheet tragetSheet,ExcelGraph graph){
  Drawing drawing = tragetSheet.createDrawingPatriarch();
  ClientAnchor anchor = drawing.createAnchor(0, 0, 0, 0, 0, 0, 15, 20);
  buildExcelChart(drawing, anchor, dataSourceSheet, graph);
}

代码示例来源:origin: cn.afterturn/easypoi-base

/**
 * 构建图形对象
 * @param dataSourceSheet
 * @param tragetSheet
 * @param graph
 */
private static void buildExcelChart(Sheet dataSourceSheet,Sheet tragetSheet,ExcelGraph graph){
  Drawing drawing = PoiExcelGraphDataUtil.getDrawingPatriarch(tragetSheet);
  ClientAnchor anchor = drawing.createAnchor(0, 0, 0, 0, 0, 0, 15, 20);
  buildExcelChart(drawing, anchor, dataSourceSheet, graph);
}

代码示例来源:origin: org.jeecg/easypoi-base

/**
 * 构建多个图形对象
 * @param dataSourceSheet
 * @param tragetSheet
 * @param graphList
 */
private static void buildExcelChart(Sheet dataSourceSheet,Sheet tragetSheet,List<ExcelGraph> graphList){
  int len=graphList.size();
  if(len==1)
  {
    buildExcelChart(dataSourceSheet, tragetSheet, graphList.get(0));
  }
  else
  {
    int drawStart=0;
    int drawEnd=20;
    Drawing drawing = tragetSheet.createDrawingPatriarch();
    for(int i=0;i<len;i++){
      ExcelGraph graph=graphList.get(i);
      ClientAnchor anchor = drawing.createAnchor(0, 0, 0, 0, 0, drawStart, 15, drawEnd);
      buildExcelChart(drawing, anchor, dataSourceSheet, graph);
      drawStart=drawStart+drawEnd;
      drawEnd=drawEnd+drawEnd;
    }
  }
}

代码示例来源:origin: cn.afterturn/easypoi-base

/**
 * 构建多个图形对象
 * @param dataSourceSheet
 * @param tragetSheet
 * @param graphList
 */
private static void buildExcelChart(Sheet dataSourceSheet,Sheet tragetSheet,List<ExcelGraph> graphList){
  int len=graphList.size();
  if(len==1)
  {
    buildExcelChart(dataSourceSheet, tragetSheet, graphList.get(0));
  }
  else
  {
    int drawStart=0;
    int drawEnd=20;
    Drawing drawing = PoiExcelGraphDataUtil.getDrawingPatriarch(tragetSheet);
    for(int i=0;i<len;i++){
      ExcelGraph graph=graphList.get(i);
      ClientAnchor anchor = drawing.createAnchor(0, 0, 0, 0, 0, drawStart, 15, drawEnd);
      buildExcelChart(drawing, anchor, dataSourceSheet, graph);
      drawStart=drawStart+drawEnd;
      drawEnd=drawEnd+drawEnd;
    }
  }
}

代码示例来源:origin: stackoverflow.com

ClientAnchor anchor = drawing.createAnchor(0, 0, 0, 0, 0, 5, 5, 20);

代码示例来源:origin: com.sqlapp/sqlapp-core

public static void setComment(CreationHelper helper, Cell cell, String text){
  int dx1 = 200, dy1 = 100, dx2 = 200, dy2 = 100;
  int col1 = cell.getColumnIndex() + 1;
  int row1 = cell.getRowIndex();
  int col2 = col1 + 3;
  String[] args=text.split("\n");
  int row2 = row1 + args.length+1;
  Drawing<?> drawing = cell.getSheet().createDrawingPatriarch();
  ClientAnchor anchor = drawing.createAnchor(dx1, dy1, dx2, dy2, col1, row1, col2, row2);
  Comment comment = drawing.createCellComment(anchor);
  //comment.setAuthor(author);
  comment.setString(helper.createRichTextString(text));
  cell.setCellComment(comment);
}

代码示例来源:origin: stackoverflow.com

ClientAnchor anchor = drawing.createAnchor(0, 0, 0, 0, 0, 5, 8, 20);

代码示例来源:origin: stackoverflow.com

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

相关文章