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

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

Introduction

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

Prototype

public float getGrayFill() 

Source Link

Document

Gets the grayscale.

Usage

From source file:net.bull.javamelody.internal.web.pdf.PdfCounterRequestContextReport.java

License:Apache License

private void writeRequests(List<CounterRequestContext> contexts) throws DocumentException, IOException {
    final PdfPCell defaultCell = getDefaultCell();
    final PdfPCell requestCell = new PdfPCell();
    final Paragraph phrase = new Paragraph("", cellFont);
    int margin = 0;
    for (final CounterRequestContext context : contexts) {
        writeRequest(context, requestCell, margin);
        margin += 5;/* w  ww . j a v  a  2s . c  o m*/
    }
    // on utilise ici PdfPCell et addElement pour que les proprits
    // leading et indentationLeft des paragraphes soient prises en compte
    requestCell.addElement(phrase);
    requestCell.setGrayFill(defaultCell.getGrayFill());
    requestCell.setPaddingTop(defaultCell.getPaddingTop());
    addCell(requestCell);
}

From source file:net.bull.javamelody.internal.web.pdf.PdfRequestAndGraphDetailReport.java

License:Apache License

private void writeRequest(CounterRequest childRequest, float executionsByRequest, boolean allChildHitsDisplayed)
        throws IOException, DocumentException {
    final PdfPCell defaultCell = getDefaultCell();
    defaultCell.setHorizontalAlignment(Element.ALIGN_LEFT);
    final Paragraph paragraph = new Paragraph(defaultCell.getLeading() + cellFont.getSize());
    if (executionsByRequest != -1) {
        paragraph.setIndentationLeft(5);
    }// www  . j a v  a2  s.com
    final Counter parentCounter = getCounterByRequestId(childRequest);
    if (parentCounter != null && parentCounter.getIconName() != null) {
        paragraph.add(new Chunk(getSmallImage(parentCounter.getIconName()), 0, -1));
    }
    paragraph.add(new Phrase(childRequest.getName(), cellFont));
    final PdfPCell requestCell = new PdfPCell();
    requestCell.addElement(paragraph);
    requestCell.setGrayFill(defaultCell.getGrayFill());
    requestCell.setPaddingTop(defaultCell.getPaddingTop());
    addCell(requestCell);

    defaultCell.setHorizontalAlignment(Element.ALIGN_RIGHT);
    if (executionsByRequest != -1) {
        addCell(nbExecutionsFormat.format(executionsByRequest));
    } else {
        addCell("");
    }
    writeRequestValues(childRequest, allChildHitsDisplayed);
}