Class DottedBorder
RoundDotsBorder.-
Nested Class Summary
Nested classes/interfaces inherited from class Border
Border.Side -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final floatThe modifier to be applied on the width to have the initial gap sizeFields inherited from class Border
_3D_GROOVE, _3D_INSET, _3D_OUTSET, _3D_RIDGE, DASHED, DASHED_FIXED, DOTTED, DOUBLE, NO_BORDER, ROUND_DOTS, SOLID, transparentColor, type, width -
Constructor Summary
ConstructorsConstructorDescriptionDottedBorder(float width) Creates a DottedBorder instance with the specified width.DottedBorder(Color color, float width) Creates a DottedBorder instance with the specified width and color.DottedBorder(Color color, float width, float opacity) Creates a DottedBorder with the specified width, color and opacity. -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(PdfCanvas canvas, float x1, float y1, float x2, float y2, float horizontalRadius1, float verticalRadius1, float horizontalRadius2, float verticalRadius2, Border.Side defaultSide, float borderWidthBefore, float borderWidthAfter) All borders are supposed to be drawn in such way, that inner content of the element is on the right from the drawing direction.voiddraw(PdfCanvas canvas, float x1, float y1, float x2, float y2, Border.Side defaultSide, float borderWidthBefore, float borderWidthAfter) All borders are supposed to be drawn in such way, that inner content of the element is on the right from the drawing direction.voiddrawCellBorder(PdfCanvas canvas, float x1, float y1, float x2, float y2, Border.Side defaultSide) Draws the border of a cell.intgetType()Returns the type of theborderMethods inherited from class Border
draw, draw, drawDiscontinuousBorders, equals, getBorderSide, getColor, getDotsGap, getIntersectionPoint, getOpacity, getStartingPointsForBorderSide, getWidth, hashCode, setColor, setWidth
-
Field Details
-
GAP_MODIFIER
private static final float GAP_MODIFIERThe modifier to be applied on the width to have the initial gap size- See Also:
-
-
Constructor Details
-
DottedBorder
public DottedBorder(float width) Creates a DottedBorder instance with the specified width. The color is set to the default: black.- Parameters:
width- width of the border
-
DottedBorder
Creates a DottedBorder instance with the specified width and color.- Parameters:
color- color of the borderwidth- width of the border
-
DottedBorder
Creates a DottedBorder with the specified width, color and opacity.- Parameters:
color- color of the borderwidth- width of the borderopacity- width of the border
-
-
Method Details
-
getType
-
draw
public void draw(PdfCanvas canvas, float x1, float y1, float x2, float y2, Border.Side defaultSide, float borderWidthBefore, float borderWidthAfter) All borders are supposed to be drawn in such way, that inner content of the element is on the right from the drawing direction. Borders are drawn in this order: top, right, bottom, left.Given points specify the line which lies on the border of the content area, therefore the border itself should be drawn to the left from the drawing direction.
borderWidthBeforeandborderWidthAfterparameters are used to define the widths of the borders that are before and after the current border, e.g. for the bottom border,borderWidthBeforespecifies width of the right border andborderWidthAfter- width of the left border. Those width are used to handle areas of border joins.- Specified by:
drawin classBorder- Parameters:
canvas- PdfCanvas to be written tox1- x coordinate of the beginning point of the element side, that should be borderedy1- y coordinate of the beginning point of the element side, that should be borderedx2- x coordinate of the ending point of the element side, that should be borderedy2- y coordinate of the ending point of the element side, that should be bordereddefaultSide- theBorder.Side, that we will fallback to, if it cannot be determined by border coordinatesborderWidthBefore- defines width of the border that is before the current oneborderWidthAfter- defines width of the border that is after the current one
-
draw
public void draw(PdfCanvas canvas, float x1, float y1, float x2, float y2, float horizontalRadius1, float verticalRadius1, float horizontalRadius2, float verticalRadius2, Border.Side defaultSide, float borderWidthBefore, float borderWidthAfter) All borders are supposed to be drawn in such way, that inner content of the element is on the right from the drawing direction. Borders are drawn in this order: top, right, bottom, left.Given points specify the line which lies on the border of the content area, therefore the border itself should be drawn to the left from the drawing direction.
borderWidthBeforeandborderWidthAfterparameters are used to define the widths of the borders that are before and after the current border, e.g. for the bottom border,borderWidthBeforespecifies width of the right border andborderWidthAfter- width of the left border. Those width are used to handle areas of border joins.horizontalRadius1,verticalRadius1,horizontalRadius2andverticalRadius2are used to draw rounded borders.- Overrides:
drawin classBorder- Parameters:
canvas- PdfCanvas to be written tox1- x coordinate of the beginning point of the element side, that should be borderedy1- y coordinate of the beginning point of the element side, that should be borderedx2- x coordinate of the ending point of the element side, that should be borderedy2- y coordinate of the ending point of the element side, that should be borderedhorizontalRadius1- defines the horizontal radius of the border's first cornerverticalRadius1- defines the vertical radius of the border's first cornerhorizontalRadius2- defines the horizontal radius of the border's second cornerverticalRadius2- defines the vertical radius of the border's second cornerdefaultSide- theBorder.Side, that we will fallback to, if it cannot be determined by border coordinatesborderWidthBefore- defines width of the border that is before the current oneborderWidthAfter- defines width of the border that is after the current one
-
drawCellBorder
public void drawCellBorder(PdfCanvas canvas, float x1, float y1, float x2, float y2, Border.Side defaultSide) Draws the border of a cell.- Specified by:
drawCellBorderin classBorder- Parameters:
canvas- PdfCanvas to be written tox1- x coordinate of the beginning point of the element side, that should be borderedy1- y coordinate of the beginning point of the element side, that should be borderedx2- x coordinate of the ending point of the element side, that should be borderedy2- y coordinate of the ending point of the element side, that should be bordereddefaultSide- theBorder.Side, that we will fallback to, if it cannot be determined by border coordinates
-