Package com.openhtmltopdf.render
Class BorderPainter
- java.lang.Object
-
- com.openhtmltopdf.render.BorderPainter
-
public class BorderPainter extends Object
-
-
Constructor Summary
Constructors Constructor Description BorderPainter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Path2DgenerateBorderBounds(Rectangle bounds, BorderPropertySet border, boolean inside)Generates a full round rectangle that is made of bounds and borderstatic Path2DgenerateBorderShape(Rectangle bounds, int side, BorderPropertySet border, boolean drawInterior)Generates one side of a borderstatic Path2DgenerateBorderShape(Rectangle bounds, int side, BorderPropertySet border, boolean drawInterior, float scaledOffset)Generates one side of a borderstatic Path2DgenerateBorderShape(Rectangle bounds, int side, BorderPropertySet border, boolean drawInterior, float scaledOffset, float widthScale)Generates one side of a borderstatic voidpaint(Rectangle bounds, int sides, BorderPropertySet border, RenderingContext ctx, int xOffset, boolean bevel)
-
-
-
Field Detail
-
TOP
public static final int TOP
- See Also:
- Constant Field Values
-
LEFT
public static final int LEFT
- See Also:
- Constant Field Values
-
BOTTOM
public static final int BOTTOM
- See Also:
- Constant Field Values
-
RIGHT
public static final int RIGHT
- See Also:
- Constant Field Values
-
ALL
public static final int ALL
- See Also:
- Constant Field Values
-
-
Method Detail
-
generateBorderBounds
public static Path2D generateBorderBounds(Rectangle bounds, BorderPropertySet border, boolean inside)
Generates a full round rectangle that is made of bounds and border- Parameters:
bounds- Dimmensions of the rectborder- The border specsinside- true if you want the inner bounds of borders- Returns:
- A Path that is all sides of the round rectangle
-
generateBorderShape
public static Path2D generateBorderShape(Rectangle bounds, int side, BorderPropertySet border, boolean drawInterior)
Generates one side of a border- Parameters:
bounds- bounds of the containerside- what side you wantborder- border propsdrawInterior- if you want it to be 2d or not, if false it will be just a line- Returns:
- a path for the side chosen!
-
generateBorderShape
public static Path2D generateBorderShape(Rectangle bounds, int side, BorderPropertySet border, boolean drawInterior, float scaledOffset)
Generates one side of a border- Parameters:
bounds- bounds of the containerside- what side you wantborder- border propsdrawInterior- if you want it to be 2d or not, if false it will be just a linescaledOffset- 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:
- a path for the side chosen!
-
generateBorderShape
public static Path2D generateBorderShape(Rectangle bounds, int side, BorderPropertySet border, boolean drawInterior, float scaledOffset, float widthScale)
Generates one side of a border- Parameters:
bounds- bounds of the containerside- what side you wantborder- border propsdrawInterior- if you want it to be 2d or not, if false it will be just a linescaledOffset- insets the border by multipling border widths by this variable, best use would be 1 or .5, cant see it for much other than thatwidthScale- scales the border widths by this factor, useful for drawing half borders for border types like groove or double- Returns:
- a path for the side chosen!
-
paint
public static void paint(Rectangle bounds, int sides, BorderPropertySet border, RenderingContext ctx, int xOffset, boolean bevel)
- Parameters:
xOffset- for determining starting point for patterns
-
-