Example usage for com.lowagie.text.html WebColors getRGBColor

List of usage examples for com.lowagie.text.html WebColors getRGBColor

Introduction

In this page you can find the example usage for com.lowagie.text.html WebColors getRGBColor.

Prototype

public static Color getRGBColor(String name) throws IllegalArgumentException 

Source Link

Document

Gives you a Color based on a name.

Usage

From source file:org.eclipse.osee.framework.ui.skynet.util.TableWriterAdaptor.java

License:Open Source License

public void writeHeader(Table table, String[] headers) throws Exception {
    for (String header : headers) {
        Cell cell = new Cell();
        cell.setHeader(true);//from   ww w . j a  v  a2  s.  c  om
        cell.setColspan(1);
        cell.setBackgroundColor(WebColors.getRGBColor("#d9d9d9"));
        cell.setHorizontalAlignment(ElementTags.ALIGN_CENTER);

        Font font = FontFactory.getFont("Times New Roman", BaseFont.CP1252, BaseFont.EMBEDDED, 9, Font.BOLD,
                WebColors.getRGBColor("#000000"));
        Paragraph paragraph = new Paragraph(header, font);
        paragraph.setAlignment(ElementTags.ALIGN_CENTER);
        cell.add(paragraph);
        table.addCell(cell);
    }
}

From source file:org.eclipse.osee.framework.ui.skynet.util.TableWriterAdaptor.java

License:Open Source License

public void writeRow(Table table, String... cellData) {
    for (String cellText : cellData) {
        Cell cell = new Cell();
        cell.setHeader(false);//  w  w  w.  j ava  2  s .c  o m
        cell.setColspan(1);
        Font font = FontFactory.getFont("Times New Roman", BaseFont.CP1252, BaseFont.EMBEDDED, 9, Font.NORMAL,
                WebColors.getRGBColor("#000000"));
        Paragraph paragraph = new Paragraph(cellText, font);
        cell.add(paragraph);
        table.addCell(cell);
    }
}

From source file:org.eclipse.osee.framework.ui.skynet.util.TableWriterAdaptor.java

License:Open Source License

public void writeDocument() throws DocumentException {
    Font font = FontFactory.getFont("Times New Roman", BaseFont.CP1252, BaseFont.EMBEDDED, 9, Font.BOLD,
            WebColors.getRGBColor("#000000"));
    Paragraph paragraph = new Paragraph(title, font);
    paragraph.setAlignment(ElementTags.ALIGN_CENTER);
    document.add(paragraph);/*from ww w .  j a  va2 s.  c  om*/
    if (table != null) {
        document.add(table);
    }
}

From source file:tk.diginspect.main.SoOFSignatories.java

private void insertCell(PdfPTable table, String text, int align, int colspan, String color,
        float BorderWidthTop, float BorderWidthBottom) {

    PdfPCell cell = new PdfPCell(new Paragraph(Font.TIMES_ROMAN, text));
    cell.setHorizontalAlignment(align);/*www .  j a  v a2 s . co  m*/
    cell.setColspan(colspan);
    cell.setBackgroundColor(WebColors.getRGBColor(color));
    cell.setPadding(5);
    cell.setBorderWidthTop(BorderWidthTop);
    cell.setBorderWidthBottom(BorderWidthBottom);
    table.addCell(cell);
}

From source file:tk.diginspect.main.SoOFSignatories.java

private void insertCell1(PdfPTable table, String text, float borderWidthTop, float borderWidthBottom,
        float fixedHeight) {
    PdfPCell cell = new PdfPCell(new Paragraph(Font.TIMES_ROMAN, text));
    cell.setBackgroundColor(WebColors.getRGBColor("#FFFFFF"));
    cell.setPadding(5);/* w  ww  .  ja v a2s.co m*/
    cell.setBorderWidthTop(borderWidthTop);
    cell.setBorderWidthBottom(borderWidthBottom);
    cell.setFixedHeight(fixedHeight);
    table.addCell(cell);
}