Example usage for com.lowagie.text.pdf PdfPCell setBorderColorBottom

List of usage examples for com.lowagie.text.pdf PdfPCell setBorderColorBottom

Introduction

In this page you can find the example usage for com.lowagie.text.pdf PdfPCell setBorderColorBottom.

Prototype

public void setBorderColorBottom(Color borderColorBottom) 

Source Link

Document

Sets the color of the bottom border.

Usage

From source file:org.mapfish.print.config.layout.CellConfig.java

License:Open Source License

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());

}

From source file:org.mapfish.print.config.layout.TableConfig.java

License:Open Source License

public void apply(PdfPCell cell, int row, int col, int nbRows, int nbCols, RenderingContext context,
        PJsonObject params) {// w w w.j  a  va 2 s  .  c  o m
    if (cells != null) {
        for (int i = 0; i < cells.size(); i++) {
            CellException cellException = cells.get(i);
            if (cellException.matches(row, col)) {
                cellException.apply(cell, context, params);
            }
        }
    }

    if (row == 0) {
        if (borderWidthTop != null)
            cell.setBorderWidthTop(borderWidthTop.floatValue());
        if (getBorderColorTopVal(context, params) != null)
            cell.setBorderColorTop(getBorderColorTopVal(context, params));
    }

    if (col == 0) {
        if (borderWidthLeft != null)
            cell.setBorderWidthLeft(borderWidthLeft.floatValue());
        if (getBorderColorLeftVal(context, params) != null)
            cell.setBorderColorLeft(getBorderColorLeftVal(context, params));
    }

    if (row == nbRows - 1) {
        if (borderWidthBottom != null)
            cell.setBorderWidthBottom(borderWidthBottom.floatValue());
        if (getBorderColorBottomVal(context, params) != null)
            cell.setBorderColorBottom(getBorderColorBottomVal(context, params));
    }

    if (col == nbCols - 1) {
        if (borderWidthRight != null)
            cell.setBorderWidthRight(borderWidthRight.floatValue());
        if (getBorderColorRightVal(context, params) != null)
            cell.setBorderColorRight(getBorderColorRightVal(context, params));
    }

}

From source file:org.unitime.timetable.webutil.PdfWebTable.java

License:Open Source License

private float addText(PdfPCell cell, String text, boolean bold, boolean italic, boolean underline, Color color,
        boolean borderTop, boolean borderBottom, boolean borderLeft, boolean borderRight, Color borderColor,
        Color bgColor) {/*from   ww  w.  j  a v a2 s .c  o  m*/

    cell.setBorderWidth(1);

    if (borderTop) {
        cell.setBorder(PdfPCell.TOP);
        if (borderColor == null)
            cell.setBorderColorTop(Color.BLACK);
        else
            cell.setBorderColorTop(borderColor);
    }

    if (borderBottom) {
        cell.setBorder(PdfPCell.BOTTOM);
        if (borderColor == null)
            cell.setBorderColorBottom(Color.BLACK);
        else
            cell.setBorderColorBottom(borderColor);
    }

    if (borderLeft) {
        cell.setBorder(PdfPCell.LEFT);
        if (borderColor == null)
            cell.setBorderColorLeft(Color.BLACK);
        else
            cell.setBorderColorLeft(borderColor);
    }

    if (borderRight) {
        cell.setBorder(PdfPCell.RIGHT);
        if (borderColor == null)
            cell.setBorderColorRight(Color.BLACK);
        else
            cell.setBorderColorRight(borderColor);
    }

    return addText(cell, text, bold, italic, underline, color, bgColor);
}