public abstract class Border extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Border.Side
Enumerates the different sides of the rectangle.
|
Modifier and Type | Field and Description |
---|---|
static int |
_3D_GROOVE
The 3D groove border.
|
static int |
_3D_INSET
The 3D inset border.
|
static int |
_3D_OUTSET
The 3D outset border.
|
static int |
_3D_RIDGE
The 3D ridge border.
|
protected Color |
color
Deprecated.
use
transparentColor instead
|
static int |
DASHED
The dashed border.
|
static int |
DOTTED
The dotted border.
|
static int |
DOUBLE
The double border.
|
static Border |
NO_BORDER
The null Border, i.e.
|
static int |
ROUND_DOTS
The round-dots border.
|
static int |
SOLID
The solid border.
|
protected TransparentColor |
transparentColor
The color of the border.
|
protected int |
type
The type of the border.
|
protected float |
width
The width of the border.
|
Modifier | Constructor and Description |
---|---|
protected |
Border(Color color, float width)
|
protected |
Border(Color color, float width, float opacity)
|
protected |
Border(float width)
Creates a border with the given width.
|
Modifier and Type | Method and Description |
---|---|
void |
draw(PdfCanvas canvas, float x1, float y1, float x2, float y2, Border.Side side, 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.
|
abstract void |
draw(PdfCanvas canvas, float x1, float y1, float x2, float y2, float borderRadius, Border.Side side, 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.
|
abstract void |
draw(PdfCanvas canvas, float x1, float y1, float x2, float y2, float borderWidthBefore, float borderWidthAfter)
Deprecated.
Will be removed in 7.1.0. use
draw(PdfCanvas, float, float, float, float, Side, float, float) instead
|
abstract void |
drawCellBorder(PdfCanvas canvas, float x1, float y1, float x2, float y2)
Draws the border of a cell.
|
boolean |
equals(Object anObject)
Indicates whether the border is equal to the given border.
|
protected Border.Side |
getBorderSide(float x1, float y1, float x2, float y2)
Deprecated.
Will be removed in 7.1.0. use
getBorderSide(float, float, float, float, Side) instead
|
protected Border.Side |
getBorderSide(float x1, float y1, float x2, float y2, Border.Side tempSide) |
Color |
getColor()
|
protected Point |
getIntersectionPoint(Point lineBeg, Point lineEnd, Point clipLineBeg, Point clipLineEnd) |
float |
getOpacity()
Gets the opacity of the border
|
abstract int |
getType()
Returns the type of the border
|
float |
getWidth()
Gets the width of the border
|
int |
hashCode() |
void |
setColor(Color color)
|
void |
setWidth(float width)
Sets the width of the border
|
public static final Border NO_BORDER
public static final int SOLID
SolidBorder
, Constant Field Values
public static final int DASHED
DashedBorder
, Constant Field Values
public static final int DOTTED
DottedBorder
, Constant Field Values
public static final int DOUBLE
DoubleBorder
, Constant Field Values
public static final int ROUND_DOTS
RoundDotsBorder
, Constant Field Values
public static final int _3D_GROOVE
GrooveBorder
, Constant Field Values
public static final int _3D_INSET
InsetBorder
, Constant Field Values
public static final int _3D_OUTSET
OutsetBorder
, Constant Field Values
public static final int _3D_RIDGE
RidgeBorder
, Constant Field Values
@Deprecated protected Color color
transparentColor
instead
Color
protected TransparentColor transparentColor
TransparentColor
protected float width
protected int type
protected Border(float width)
width
- the width which the border should have
protected Border(Color color, float width)
color
- the color which the border should have
width
- the width which the border should have
protected Border(Color color, float width, float opacity)
color
- the color which the border should have
width
- the width which the border should have
opacity
- the opacity which border should have; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent
@Deprecated public abstract void draw(PdfCanvas canvas, float x1, float y1, float x2, float y2, float borderWidthBefore, float borderWidthAfter)
draw(PdfCanvas, float, float, float, float, Side, float, float)
instead
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
and borderWidthAfter
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 and borderWidthAfter
- width of the left border. Those width are used to handle areas of border joins.
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
borderWidthBefore
- defines width of the border that is before the current one
borderWidthAfter
- defines width of the border that is after the current one
public void draw(PdfCanvas canvas, float x1, float y1, float x2, float y2, Border.Side side, 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
and borderWidthAfter
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 and borderWidthAfter
- width of the left border. Those width are used to handle areas of border joins.
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
side
- the Border.Side
, that represents element side, that should be bordered
borderWidthBefore
- defines width of the border that is before the current one
borderWidthAfter
- defines width of the border that is after the current one
public abstract void draw(PdfCanvas canvas, float x1, float y1, float x2, float y2, float borderRadius, Border.Side side, 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
and borderWidthAfter
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 and borderWidthAfter
- width of the left border. Those width are used to handle areas of border joins.
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
borderRadius
- border radius
side
- the Border.Side
, that represents element side, that should be bordered
borderWidthBefore
- defines width of the border that is before the current one
borderWidthAfter
- defines width of the border that is after the current one
public abstract void drawCellBorder(PdfCanvas canvas, float x1, float y1, float x2, float y2)
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
public abstract int getType()
border
public float getOpacity()
border
public float getWidth()
border
public void setColor(Color color)
public void setWidth(float width)
border
public boolean equals(Object anObject)
@Deprecated protected Border.Side getBorderSide(float x1, float y1, float x2, float y2)
getBorderSide(float, float, float, float, Side)
instead
side
corresponded to the line between two points. Notice that we consider the rectangle traversal to be clockwise. If the rectangle sides are not parallel to the corresponding page sides the result is Side.NONE
x1
- the abscissa of the left-bottom point
y1
- the ordinate of the left-bottom point
x2
- the abscissa of the right-top point
y2
- the ordinate of the right-top point
side
protected Border.Side getBorderSide(float x1, float y1, float x2, float y2, Border.Side tempSide)
Copyright © 1998–2017 iText Group NV. All rights reserved.