@@ -42,6 +42,8 @@ source product.
42424343*/
4444using System ;
45+ using Common . Logging ;
46+ using iText . IO . Util ;
4547using iText . Kernel . Colors ;
4648using iText . Kernel . Geom ;
4749using iText . Kernel . Pdf . Canvas ;
@@ -204,22 +206,80 @@ public abstract void Draw(PdfCanvas canvas, float x1, float y1, float x2, float
204206 /// <code>borderWidthAfter</code> - width of the left border. Those width are used to handle areas
205207 /// of border joins.
206208 /// </p>
209+ /// <p>
210+ /// <code>borderRadius</code> is used to draw rounded borders.
211+ /// </p>
207212 /// </remarks>
208213 /// <param name="canvas">PdfCanvas to be written to</param>
209214 /// <param name="x1">x coordinate of the beginning point of the element side, that should be bordered</param>
210215 /// <param name="y1">y coordinate of the beginning point of the element side, that should be bordered</param>
211216 /// <param name="x2">x coordinate of the ending point of the element side, that should be bordered</param>
212217 /// <param name="y2">y coordinate of the ending point of the element side, that should be bordered</param>
213- /// <param name="borderRadius">border radius</param>
218+ /// <param name="borderRadius">defines the radius of the element's corners </param>
214219 /// <param name="defaultSide">
215220 /// the
216221 /// <see cref="Side"/>
217222 /// , that we will fallback to, if it cannot be determined by border coordinates
218223 /// </param>
219224 /// <param name="borderWidthBefore">defines width of the border that is before the current one</param>
220225 /// <param name="borderWidthAfter">defines width of the border that is after the current one</param>
221- public abstract void Draw ( PdfCanvas canvas , float x1 , float y1 , float x2 , float y2 , float borderRadius , Border . Side
222- defaultSide , float borderWidthBefore , float borderWidthAfter ) ;
226+ public virtual void Draw ( PdfCanvas canvas , float x1 , float y1 , float x2 , float y2 , float borderRadius , Border . Side
227+ defaultSide , float borderWidthBefore , float borderWidthAfter ) {
228+ Draw ( canvas , x1 , y1 , x2 , y2 , borderRadius , borderRadius , borderRadius , borderRadius , defaultSide , borderWidthBefore
229+ , borderWidthAfter ) ;
230+ }
231+
232+ /// <summary>
233+ /// <p>
234+ /// All borders are supposed to be drawn in such way, that inner content of the element is on the right from the
235+ /// drawing direction.
236+ /// </summary>
237+ /// <remarks>
238+ /// <p>
239+ /// All borders are supposed to be drawn in such way, that inner content of the element is on the right from the
240+ /// drawing direction. Borders are drawn in this order: top, right, bottom, left.
241+ /// </p>
242+ /// <p>
243+ /// Given points specify the line which lies on the border of the content area,
244+ /// therefore the border itself should be drawn to the left from the drawing direction.
245+ /// </p>
246+ /// <p>
247+ /// <code>borderWidthBefore</code> and <code>borderWidthAfter</code> parameters are used to
248+ /// define the widths of the borders that are before and after the current border, e.g. for
249+ /// the bottom border, <code>borderWidthBefore</code> specifies width of the right border and
250+ /// <code>borderWidthAfter</code> - width of the left border. Those width are used to handle areas
251+ /// of border joins.
252+ /// </p>
253+ /// <p>
254+ /// <code>horizontalRadius1</code>, <code>verticalRadius1</code>, <code>horizontalRadius2</code>
255+ /// and <code>verticalRadius2</code> are used to draw rounded borders.
256+ /// </p>
257+ /// </remarks>
258+ /// <param name="canvas">PdfCanvas to be written to</param>
259+ /// <param name="x1">x coordinate of the beginning point of the element side, that should be bordered</param>
260+ /// <param name="y1">y coordinate of the beginning point of the element side, that should be bordered</param>
261+ /// <param name="x2">x coordinate of the ending point of the element side, that should be bordered</param>
262+ /// <param name="y2">y coordinate of the ending point of the element side, that should be bordered</param>
263+ /// <param name="horizontalRadius1">defines the horizontal radius of the border's first corner</param>
264+ /// <param name="verticalRadius1">defines the vertical radius of the border's first corner</param>
265+ /// <param name="horizontalRadius2">defines the horizontal radius of the border's second corner</param>
266+ /// <param name="verticalRadius2">defines the vertical radius of the border's second corner</param>
267+ /// <param name="defaultSide">
268+ /// the
269+ /// <see cref="Side"/>
270+ /// , that we will fallback to, if it cannot be determined by border coordinates
271+ /// </param>
272+ /// <param name="borderWidthBefore">defines width of the border that is before the current one</param>
273+ /// <param name="borderWidthAfter">defines width of the border that is after the current one</param>
274+ public virtual void Draw ( PdfCanvas canvas , float x1 , float y1 , float x2 , float y2 , float horizontalRadius1
275+ , float verticalRadius1 , float horizontalRadius2 , float verticalRadius2 , Border . Side defaultSide , float
276+ borderWidthBefore , float borderWidthAfter ) {
277+ ILog logger = LogManager . GetLogger ( typeof ( iText . Layout . Borders . Border ) ) ;
278+ logger . Warn ( MessageFormatUtil . Format ( iText . IO . LogMessageConstant . METHOD_IS_NOT_IMPLEMENTED_BY_DEFAULT_OTHER_METHOD_WILL_BE_USED
279+ , "Border#draw(PdfCanvas, float, float, float, float, float, float, float, float, Side, float, float" ,
280+ "Border#draw(PdfCanvas, float, float, float, float, Side, float, float)" ) ) ;
281+ Draw ( canvas , x1 , y1 , x2 , y2 , defaultSide , borderWidthBefore , borderWidthAfter ) ;
282+ }
223283
224284 /// <summary>Draws the border of a cell.</summary>
225285 /// <param name="canvas">PdfCanvas to be written to</param>
0 commit comments