Package com.itextpdf.layout.borders
Class Border3D
java.lang.Object
com.itextpdf.layout.borders.Border
com.itextpdf.layout.borders.Border3D
- Direct Known Subclasses:
-
GrooveBorder
,InsetBorder
,OutsetBorder
,RidgeBorder
Represents a border that is displayed using a 3D effect.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.itextpdf.layout.borders.Border
Border.Side
-
Field Summary
Fields inherited from class com.itextpdf.layout.borders.Border
_3D_GROOVE, _3D_INSET, _3D_OUTSET, _3D_RIDGE, DASHED, DASHED_FIXED, DOTTED, DOUBLE, NO_BORDER, ROUND_DOTS, SOLID, transparentColor, type, width
-
Constructor Summary
ModifierConstructorDescriptionprotected
Border3D
(float width) Creates a Border3D instance with the specified width.protected
Border3D
(DeviceCmyk color, float width) Creates a Border3D instance with the specified width and color.protected
Border3D
(DeviceCmyk color, float width, float opacity) Creates a Border3D instance with the specified width, color and opacity.protected
Border3D
(DeviceGray color, float width) Creates a Border3D instance with the specified width and color.protected
Border3D
(DeviceGray color, float width, float opacity) Creates a Border3D instance with the specified width, color and opacity.protected
Creates a Border3D instance with the specified width and color.protected
Creates a Border3D instance with the specified width, color and opacity. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.void
drawCellBorder
(PdfCanvas canvas, float x1, float y1, float x2, float y2, Border.Side defaultSide) Draws the border of a cell.protected Color
Makes theBorder.transparentColor
color of the border darker and returns the resultprotected abstract void
setInnerHalfColor
(PdfCanvas canvas, Border.Side side) Sets the fill color for the inner half of3D Border
protected abstract void
setOuterHalfColor
(PdfCanvas canvas, Border.Side side) Sets the fill color for the outer half of3D Border
Methods inherited from class com.itextpdf.layout.borders.Border
draw, draw, draw, drawDiscontinuousBorders, equals, getBorderSide, getColor, getDotsGap, getIntersectionPoint, getOpacity, getStartingPointsForBorderSide, getType, getWidth, hashCode, setColor, setWidth
-
Constructor Details
-
Border3D
protected Border3D(float width) Creates a Border3D instance with the specified width. Also sets the color to gray.- Parameters:
-
width
- with of the border
-
Border3D
Creates a Border3D instance with the specified width and color.- Parameters:
-
color
- color of the border -
width
- width of the border
-
Border3D
Creates a Border3D instance with the specified width and color.- Parameters:
-
color
- color of the border -
width
- width of the border
-
Border3D
Creates a Border3D instance with the specified width and color.- Parameters:
-
color
- color of the border -
width
- width of the border
-
Border3D
Creates a Border3D instance with the specified width, color and opacity.- Parameters:
-
color
- color of the border -
width
- width of the border -
opacity
- opacity of the border
-
Border3D
Creates a Border3D instance with the specified width, color and opacity.- Parameters:
-
color
- color of the border -
width
- width of the border -
opacity
- opacity of the border
-
Border3D
Creates a Border3D instance with the specified width, color and opacity.- Parameters:
-
color
- color of the border -
width
- width of the border -
opacity
- opacity of the border
-
-
Method Details
-
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.
borderWidthBefore
andborderWidthAfter
parameters are used to define the widths of the borders that are before and after the current border, e.g. for the bottom border,borderWidthBefore
specifies width of the right border andborderWidthAfter
- width of the left border. Those width are used to handle areas of border joins.- Specified by:
-
draw
in classBorder
- Parameters:
-
canvas
- PdfCanvas to be written to -
x1
- x coordinate of the beginning point of the element side, that should be bordered -
y1
- y coordinate of the beginning point of the element side, that should be bordered -
x2
- x coordinate of the ending point of the element side, that should be bordered -
y2
- y coordinate of the ending point of the element side, that should be bordered -
defaultSide
- theBorder.Side
, that we will fallback to, if it cannot be determined by border coordinates -
borderWidthBefore
- defines width of the border that is before the current one -
borderWidthAfter
- 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:
-
drawCellBorder
in classBorder
- Parameters:
-
canvas
- PdfCanvas to be written to -
x1
- x coordinate of the beginning point of the element side, that should be bordered -
y1
- y coordinate of the beginning point of the element side, that should be bordered -
x2
- x coordinate of the ending point of the element side, that should be bordered -
y2
- y coordinate of the ending point of the element side, that should be bordered -
defaultSide
- theBorder.Side
, that we will fallback to, if it cannot be determined by border coordinates
-
getDarkerColor
Makes theBorder.transparentColor
color of the border darker and returns the result- Returns:
- The darker color
-
setInnerHalfColor
Sets the fill color for the inner half of3D Border
- Parameters:
-
canvas
- PdfCanvas the color will be applied on -
side
- theside
the color will be applied on
-
setOuterHalfColor
Sets the fill color for the outer half of3D Border
- Parameters:
-
canvas
- PdfCanvas the color will be applied on -
side
- theside
the color will be applied on
-