Top Inners Fields Constructors Methods
com.openhtmltopdf.render

public Class BorderPainter

extends Object
Class Inheritance
Imports
java.awt.BasicStroke, .Rectangle, .Shape, .Stroke, java.awt.geom.AffineTransform, .Arc2D, .Area, .Path2D, .Rectangle2D, com.openhtmltopdf.css.constants.IdentValue, com.openhtmltopdf.css.parser.FSColor, .FSRGBColor, com.openhtmltopdf.css.style.BorderRadiusCorner, com.openhtmltopdf.css.style.derived.BorderPropertySet, com.openhtmltopdf.extend.OutputDevice

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
public static final int
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static void
appendPath(Path2D path, float xOffset, float yOffset, float radiusVert, float radiusHoriz, float startAngle, float distance, float topWidth, float sideWidth, float scaleOffset, boolean left, float widthScale)

public static Path2D

Returns:

A Path that is all sides of the round rectangle
generateBorderBounds
(Rectangle
Dimmensions of the rect
bounds
,
BorderPropertySet
The border specs
border
,
boolean
true if you want the inner bounds of borders
inside
)

Generates a full round rectangle that is made of bounds and border

public static Path2D

Returns:

a path for the side chosen!
generateBorderShape
(Rectangle
bounds of the container
bounds
,
int
what side you want
side
,
BorderPropertySet
border props
border
,
boolean
if you want it to be 2d or not, if false it will be just a line
drawInterior
)

Generates one side of a border

public static Path2D

Returns:

a path for the side chosen!
generateBorderShape
(Rectangle
bounds of the container
bounds
,
int
what side you want
side
,
BorderPropertySet
border props
border
,
boolean
if you want it to be 2d or not, if false it will be just a line
drawInterior
,
float
insets the border by multipling border widths by this variable, best use would be 1 or .5, cant see it for much other than that
scaledOffset
)

Generates one side of a border

public static Path2D

Returns:

a path for the side chosen!
generateBorderShape
(Rectangle
bounds of the container
bounds
,
int
what side you want
side
,
BorderPropertySet
border props
border
,
boolean
if you want it to be 2d or not, if false it will be just a line
drawInterior
,
float
insets the border by multipling border widths by this variable, best use would be 1 or .5, cant see it for much other than that
scaledOffset
,
float
scales the border widths by this factor, useful for drawing half borders for border types like groove or double
widthScale
)

Generates one side of a border

private static Shape
generateSimpleBorderShape(Rectangle bounds, int currentSide, BorderPropertySet border)

Generate a simple rectangle without beveling for a solid border side.

public static void
paint(Rectangle bounds, int sides, BorderPropertySet border, RenderingContext ctx, int
for determining starting point for patterns
xOffset
,
boolean bevel)

private static void
paintBorderSide(OutputDevice outputDevice, final BorderPropertySet border, final Rectangle bounds, final int sides, int currentSide, final IdentValue borderSideStyle, int xOffset, boolean bevel)

private static void
paintBorderSideShape(OutputDevice outputDevice, final Rectangle bounds, final BorderPropertySet border, final BorderPropertySet high, final BorderPropertySet low, final float offset, final float scale, final int sides, int currentSide, boolean bevel)

private static void
paintDoubleBorder(OutputDevice outputDevice, BorderPropertySet border, Rectangle bounds, int sides, int currentSide, boolean bevel)

private static void
paintPatternedRect(OutputDevice outputDevice, final Rectangle bounds, final BorderPropertySet border, final BorderPropertySet color, final float[] pattern, final int sides, final int currentSide, int
for inline borders, to determine dash_phase of top and bottom
xOffset
)

private static void
paintSolid(OutputDevice outputDevice, final Rectangle bounds, final BorderPropertySet border, final float offset, final float scale, final int sides, int currentSide, boolean bevel)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ALLback to summary
public static final int ALL
BOTTOMback to summary
public static final int BOTTOM
LEFTback to summary
public static final int LEFT
TOPback to summary
public static final int TOP

Constructor Detail

BorderPainterback to summary
public BorderPainter()

Method Detail

appendPathback to summary
private static void appendPath(Path2D path, float xOffset, float yOffset, float radiusVert, float radiusHoriz, float startAngle, float distance, float topWidth, float sideWidth, float scaleOffset, boolean left, float widthScale)
generateBorderBoundsback to summary
public static Path2D generateBorderBounds(Rectangle bounds, BorderPropertySet border, boolean inside)

Generates a full round rectangle that is made of bounds and border

Parameters
bounds:Rectangle

Dimmensions of the rect

border:BorderPropertySet

The border specs

inside:boolean

true if you want the inner bounds of borders

Returns:Path2D

A Path that is all sides of the round rectangle

generateBorderShapeback to summary
public static Path2D generateBorderShape(Rectangle bounds, int side, BorderPropertySet border, boolean drawInterior)

Generates one side of a border

Parameters
bounds:Rectangle

bounds of the container

side:int

what side you want

border:BorderPropertySet

border props

drawInterior:boolean

if you want it to be 2d or not, if false it will be just a line

Returns:Path2D

a path for the side chosen!

generateBorderShapeback to summary
public static Path2D generateBorderShape(Rectangle bounds, int side, BorderPropertySet border, boolean drawInterior, float scaledOffset)

Generates one side of a border

Parameters
bounds:Rectangle

bounds of the container

side:int

what side you want

border:BorderPropertySet

border props

drawInterior:boolean

if you want it to be 2d or not, if false it will be just a line

scaledOffset:float

insets the border by multipling border widths by this variable, best use would be 1 or .5, cant see it for much other than that

Returns:Path2D

a path for the side chosen!

generateBorderShapeback to summary
public static Path2D generateBorderShape(Rectangle bounds, int side, BorderPropertySet border, boolean drawInterior, float scaledOffset, float widthScale)

Generates one side of a border

Parameters
bounds:Rectangle

bounds of the container

side:int

what side you want

border:BorderPropertySet

border props

drawInterior:boolean

if you want it to be 2d or not, if false it will be just a line

scaledOffset:float

insets the border by multipling border widths by this variable, best use would be 1 or .5, cant see it for much other than that

widthScale:float

scales the border widths by this factor, useful for drawing half borders for border types like groove or double

Returns:Path2D

a path for the side chosen!

generateSimpleBorderShapeback to summary
private static Shape generateSimpleBorderShape(Rectangle bounds, int currentSide, BorderPropertySet border)

Generate a simple rectangle without beveling for a solid border side. Turning off beveling should disable anti-aliasing and work better with table cell borders. See https://github.com/danfickle/openhtmltopdf/issues/752

paintback to summary
public static void paint(Rectangle bounds, int sides, BorderPropertySet border, RenderingContext ctx, int xOffset, boolean bevel)
Parameters
xOffset:int

for determining starting point for patterns

paintBorderSideback to summary
private static void paintBorderSide(OutputDevice outputDevice, final BorderPropertySet border, final Rectangle bounds, final int sides, int currentSide, final IdentValue borderSideStyle, int xOffset, boolean bevel)
paintBorderSideShapeback to summary
private static void paintBorderSideShape(OutputDevice outputDevice, final Rectangle bounds, final BorderPropertySet border, final BorderPropertySet high, final BorderPropertySet low, final float offset, final float scale, final int sides, int currentSide, boolean bevel)
paintDoubleBorderback to summary
private static void paintDoubleBorder(OutputDevice outputDevice, BorderPropertySet border, Rectangle bounds, int sides, int currentSide, boolean bevel)
paintPatternedRectback to summary
private static void paintPatternedRect(OutputDevice outputDevice, final Rectangle bounds, final BorderPropertySet border, final BorderPropertySet color, final float[] pattern, final int sides, final int currentSide, int xOffset)
Parameters
xOffset:int

for inline borders, to determine dash_phase of top and bottom

paintSolidback to summary
private static void paintSolid(OutputDevice outputDevice, final Rectangle bounds, final BorderPropertySet border, final float offset, final float scale, final int sides, int currentSide, boolean bevel)
com.openhtmltopdf.render back to summary

private Class BorderPainter.RelativeBorderProperties

extends Object
Class Inheritance
  • java.lang.Object
  • com.openhtmltopdf.render.BorderPainter.RelativeBorderProperties

Field Summary

Modifier and TypeField and Description
private final boolean
private final float
private final BorderRadiusCorner
private final float
private final BorderRadiusCorner
private final double
private final float

Constructor Summary

AccessConstructor and Description
public
RelativeBorderProperties(Rectangle bounds, BorderPropertySet props, float borderScaleOffset, int side, float scaledOffset, float widthScale)

Method Summary

Modifier and TypeMethod and Description
public float
public BorderRadiusCorner
public float
public BorderRadiusCorner
private double
public float
private boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_dimmensionsSwappedback to summary
private final boolean _dimmensionsSwapped
_leftback to summary
private final float _left
_leftCornerback to summary
private final BorderRadiusCorner _leftCorner
_rightback to summary
private final float _right
_rightCornerback to summary
private final BorderRadiusCorner _rightCorner
_rotationback to summary
private final double _rotation
_topback to summary
private final float _top

Constructor Detail

RelativeBorderPropertiesback to summary
public RelativeBorderProperties(Rectangle bounds, BorderPropertySet props, float borderScaleOffset, int side, float scaledOffset, float widthScale)

Method Detail

getLeftback to summary
public float getLeft()
getLeftCornerback to summary
public BorderRadiusCorner getLeftCorner()
getRightback to summary
public float getRight()
getRightCornerback to summary
public BorderRadiusCorner getRightCorner()
getRotationback to summary
private double getRotation()
getTopback to summary
public float getTop()
isDimmensionsSwappedback to summary
private boolean isDimmensionsSwapped()