コード例 #1
0
ファイル: CellConfig.java プロジェクト: ahennr/mapfish-print
  protected void apply(PdfPCell cell, RenderingContext context, PJsonObject params) {
    if (paddingLeft != null) cell.setPaddingLeft(paddingLeft.floatValue());
    if (paddingRight != null) cell.setPaddingRight(paddingRight.floatValue());
    if (paddingTop != null) cell.setPaddingTop(paddingTop.floatValue());
    if (paddingBottom != null) cell.setPaddingBottom(paddingBottom.floatValue());

    if (borderWidthLeft != null) cell.setBorderWidthLeft(borderWidthLeft.floatValue());
    if (borderWidthRight != null) cell.setBorderWidthRight(borderWidthRight.floatValue());
    if (borderWidthTop != null) cell.setBorderWidthTop(borderWidthTop.floatValue());
    if (borderWidthBottom != null) cell.setBorderWidthBottom(borderWidthBottom.floatValue());

    if (getBorderColorLeftVal(context, params) != null)
      cell.setBorderColorLeft(getBorderColorLeftVal(context, params));
    if (getBorderColorRightVal(context, params) != null)
      cell.setBorderColorRight(getBorderColorRightVal(context, params));
    if (getBorderColorTopVal(context, params) != null)
      cell.setBorderColorTop(getBorderColorTopVal(context, params));
    if (getBorderColorBottomVal(context, params) != null)
      cell.setBorderColorBottom(getBorderColorBottomVal(context, params));

    if (getBackgroundColorVal(context, params) != null)
      cell.setBackgroundColor(getBackgroundColorVal(context, params));

    if (align != null) cell.setHorizontalAlignment(align.getCode());
    if (vertAlign != null) cell.setVerticalAlignment(vertAlign.getCode());
  }
コード例 #2
0
ファイル: Cell.java プロジェクト: gthiruva/ilarkesto
 @Override
 public Element getITextElement() {
   PdfPCell cell = new PdfPCell();
   cell.setBorderColorTop(getBorderTopColor());
   cell.setBorderColorBottom(getBorderBottomColor());
   cell.setBorderColorLeft(getBorderLeftColor());
   cell.setBorderColorRight(getBorderRightColor());
   cell.setBorderWidthTop(APdfBuilder.mmToPoints(getBorderTopWidth()));
   cell.setBorderWidthBottom(APdfBuilder.mmToPoints(getBorderBottomWidth()));
   cell.setBorderWidthLeft(APdfBuilder.mmToPoints(getBorderLeftWidth()));
   cell.setBorderWidthRight(APdfBuilder.mmToPoints(getBorderRightWidth()));
   cell.setPadding(0);
   cell.setPaddingTop(APdfBuilder.mmToPoints(getPaddingTop()));
   cell.setPaddingBottom(APdfBuilder.mmToPoints(getPaddingBottom()));
   cell.setPaddingLeft(APdfBuilder.mmToPoints(getPaddingLeft()));
   cell.setPaddingRight(APdfBuilder.mmToPoints(getPaddingRight()));
   cell.setExtraParagraphSpace(0);
   cell.setIndent(0);
   cell.setUseBorderPadding(false);
   cell.setBackgroundColor(getBackgroundColor());
   cell.setColspan(getColspan());
   for (ItextElement element : elements) cell.addElement(element.getITextElement());
   return cell;
 }