private PdfContentByte bulidCellBorder(PdfContentByte[] canvases,Border border){ PdfContentByte cb=canvases[PdfPTable.LINECANVAS]; cb.saveState(); BigDecimal w=new BigDecimal(border.getWidth()); cb.setLineWidth(w.divide(new BigDecimal(2),10,RoundingMode.HALF_UP).floatValue()); if(border.getStyle().equals(BorderStyle.dashed)){ cb.setLineDash(new float[]{2f,3f,1f},2); } String borderColor[]=border.getColor().split(","); cb.setColorStroke(new BaseColor(Integer.valueOf(borderColor[0]),Integer.valueOf(borderColor[1]),Integer.valueOf(borderColor[2]))); return cb; } }
public Chunk statusMarker(Status status) { switch (status) { case Passed: return fontAwesomeAdapter().symbol("check-circle", symbolSize, BaseColor.GREEN.darker()); case Skipped: return fontAwesomeAdapter().symbol("exclamation-circle", symbolSize, BaseColor.ORANGE); case Undefined: return fontAwesomeAdapter().symbol("question-circle", symbolSize, BaseColor.RED.darker()); case Failed: return fontAwesomeAdapter().symbol("ban", symbolSize, BaseColor.RED); case Pending: return fontAwesomeAdapter().symbol("gears", symbolSize, BaseColor.ORANGE); default: return fontAwesomeAdapter().symbol("minus-circle", symbolSize, BaseColor.BLUE); } }
private void emitBody(PdfPTable table, TagViews views, ITextContext emitterContext) { Styles styles = emitterContext.styles(); CellStyler styler = bodyCellStyler; if (styler == null) styler = new DefaultBodyCellStyler(styles); for (TagView tagView : views) { int nbTotal = tagView.nbTotal(); int nbFailed = tagView.nbFailed(); int nbPassed = tagView.nbPassed(); int nbOther = nbTotal - (nbFailed + nbPassed); Phrase tagPhrase = new Phrase(tagView.description(), styler.cellFont()); PdfPCell tagCell = styler.applyStyle(new PdfPCell(tagPhrase)); PdfPCell passedCell = valuedCell(nbPassed, nbTotal, styler, constant(BaseColor.GREEN.darker())); PdfPCell failedCell = valuedCell(nbFailed, nbTotal, styler, constant(BaseColor.RED.darker())); PdfPCell otherCell = valuedCell(nbOther, nbTotal, styler, constant(BaseColor.YELLOW)); table.addCell(tagCell); table.addCell(passedCell); table.addCell(failedCell); table.addCell(otherCell); } }
/** * Obtain the footer background color; Meant to be overriden if a different style is desired. * @return The footer background color. */ protected BaseColor getFooterBackgroundColor() { return new BaseColor(0xce, 0xcf, 0xce); }
public LabColor(PdfLabColor labColorSpace, float l, float a, float b) { super(ExtendedColor.TYPE_LAB); this.labColorSpace = labColorSpace; this.l = l; this.a = a; this.b = b; BaseColor altRgbColor = labColorSpace.lab2Rgb(l, a, b); setValue(altRgbColor.getRed(), altRgbColor.getGreen(), altRgbColor.getBlue(), 255); }
app.setGrayFill(1); drawTopFrame(app); app.setColorFill(actual.darker()); drawBottomFrame(app);
/** * Set the font color used to render the header text; Meant to be overridden if a different header style is desired. * @return The font color used to render the header text. */ protected BaseColor getHeaderFontColor() { return new BaseColor(0x00, 0x00, 0x00); }
/** * Make this BaseColor brighter. Factor used is 0.7. * @return the new BaseColor */ public BaseColor brighter() { int r = getRed(); int g = getGreen(); int b = getBlue(); int i = (int) (1.0 / (1.0 - FACTOR)); if (r == 0 && g == 0 && b == 0) { return new BaseColor(i, i, i); } if (r > 0 && r < i) r = i; if (g > 0 && g < i) g = i; if (b > 0 && b < i) b = i; return new BaseColor(Math.min((int) (r / FACTOR), 255), Math.min((int) (g / FACTOR), 255), Math.min((int) (b / FACTOR), 255)); }
public LabColor(PdfLabColor labColorSpace, float l, float a, float b) { super(ExtendedColor.TYPE_LAB); this.labColorSpace = labColorSpace; this.l = l; this.a = a; this.b = b; BaseColor altRgbColor = labColorSpace.lab2Rgb(l, a, b); setValue(altRgbColor.getRed(), altRgbColor.getGreen(), altRgbColor.getBlue(), 255); }
@Override public boolean equals(Object obj) { return obj instanceof UncoloredPattern && (((UncoloredPattern)obj).painter).equals(this.painter) && (((UncoloredPattern)obj).color).equals(this.color) && ((UncoloredPattern)obj).tint == this.tint; }
app.setGrayFill(1); drawTopFrame(app); app.setColorFill(actual.darker()); drawBottomFrame(app);
/** * Obtain the background color used to render the header; Meant to be overridden if a different header background * color is desired. * @return The backgrounc color used to render the header. */ protected BaseColor getHeaderBackgroundColor() { return new BaseColor(0xee, 0xee, 0xee); }