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; } }
/** * Changes the value of the <VAR>line dash pattern</VAR>. * <P> * The line dash pattern controls the pattern of dashes and gaps used to stroke paths. * It is specified by an <I>array</I> and a <I>phase</I>. The array specifies the length * of the alternating dashes and gaps. The phase specifies the distance into the dash * pattern to start the dash.<BR> * * @param phase the value of the phase * @param unitsOn the number of units that must be 'on' (equals the number of units that must be 'off'). */ public void setLineDash(final float unitsOn, final float phase) { setLineDash((double) unitsOn, (double) phase); }
/** * Changes the value of the <VAR>line dash pattern</VAR>. * <P> * The line dash pattern controls the pattern of dashes and gaps used to stroke paths. * It is specified by an <I>array</I> and a <I>phase</I>. The array specifies the length * of the alternating dashes and gaps. The phase specifies the distance into the dash * pattern to start the dash.<BR> * * @param phase the value of the phase */ public void setLineDash(final float phase) { setLineDash((double) phase); }
/** * Changes the value of the <VAR>line dash pattern</VAR>. * <P> * The line dash pattern controls the pattern of dashes and gaps used to stroke paths. * It is specified by an <I>array</I> and a <I>phase</I>. The array specifies the length * of the alternating dashes and gaps. The phase specifies the distance into the dash * pattern to start the dash.<BR> * * @param phase the value of the phase */ public void setLineDash(final float phase) { setLineDash((double) phase); }
/** * Changes the value of the <VAR>line dash pattern</VAR>. * <P> * The line dash pattern controls the pattern of dashes and gaps used to stroke paths. * It is specified by an <I>array</I> and a <I>phase</I>. The array specifies the length * of the alternating dashes and gaps. The phase specifies the distance into the dash * pattern to start the dash.<BR> * * @param phase the value of the phase * @param unitsOn the number of units that must be 'on' * @param unitsOff the number of units that must be 'off' */ public void setLineDash(final float unitsOn, final float unitsOff, final float phase) { setLineDash((double) unitsOn, (double) unitsOff, (double) phase); }
/** * Changes the value of the <VAR>line dash pattern</VAR>. * <P> * The line dash pattern controls the pattern of dashes and gaps used to stroke paths. * It is specified by an <I>array</I> and a <I>phase</I>. The array specifies the length * of the alternating dashes and gaps. The phase specifies the distance into the dash * pattern to start the dash.<BR> * * @param phase the value of the phase * @param unitsOn the number of units that must be 'on' (equals the number of units that must be 'off'). */ public void setLineDash(final float unitsOn, final float phase) { setLineDash((double) unitsOn, (double) phase); }
/** * Changes the value of the <VAR>line dash pattern</VAR>. * <P> * The line dash pattern controls the pattern of dashes and gaps used to stroke paths. * It is specified by an <I>array</I> and a <I>phase</I>. The array specifies the length * of the alternating dashes and gaps. The phase specifies the distance into the dash * pattern to start the dash.<BR> * * @param phase the value of the phase * @param unitsOn the number of units that must be 'on' * @param unitsOff the number of units that must be 'off' */ public void setLineDash(final float unitsOn, final float unitsOff, final float phase) { setLineDash((double) unitsOn, (double) unitsOff, (double) phase); }
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; } }
/** * @see com.itextpdf.text.pdf.draw.DrawInterface#draw(com.itextpdf.text.pdf.PdfContentByte, float, float, float, float, float) */ public void draw(PdfContentByte canvas, float llx, float lly, float urx, float ury, float y) { canvas.saveState(); canvas.setLineWidth(lineWidth); canvas.setLineCap(PdfContentByte.LINE_CAP_ROUND); canvas.setLineDash(0, gap, gap / 2); drawLine(canvas, llx, urx, y); canvas.restoreState(); }
/** * @see com.itextpdf.text.pdf.draw.DrawInterface#draw(com.itextpdf.text.pdf.PdfContentByte, float, float, float, float, float) */ public void draw(PdfContentByte canvas, float llx, float lly, float urx, float ury, float y) { canvas.saveState(); canvas.setLineWidth(lineWidth); canvas.setLineCap(PdfContentByte.LINE_CAP_ROUND); canvas.setLineDash(0, gap, gap / 2); drawLine(canvas, llx, urx, y); canvas.restoreState(); }
switch (style) { case MetaPen.PS_DASH: cb.setLineDash(18, 6, 0); break; case MetaPen.PS_DASHDOT: break; case MetaPen.PS_DOT: cb.setLineDash(3, 0); break; default: cb.setLineDash(0); break;
switch (style) { case MetaPen.PS_DASH: cb.setLineDash(18, 6, 0); break; case MetaPen.PS_DASHDOT: break; case MetaPen.PS_DOT: cb.setLineDash(3, 0); break; default: cb.setLineDash(0); break;