public class BorderPainter extends Object
Modifier and Type | Field and Description |
---|---|
protected static int |
BOTTOM
Convention index of bottom border
|
protected static int |
BOTTOM_LEFT
Convention index of bottom-left border corners
|
protected static int |
BOTTOM_RIGHT
Convention index of bottom-right border corners
|
protected static float |
DASHED_BORDER_LENGTH_FACTOR
The length of the dash as a factor of the border width i.e.
|
static float |
DASHED_BORDER_SPACE_RATIO
The ratio between a solid dash and the white-space in a dashed-border
|
protected static int |
LEFT
Convention index of left border
|
protected static int |
RIGHT
Convention index of right border
|
protected static int |
TOP
Convention index of before top
|
protected static int |
TOP_LEFT
Convention index of top-left border corners
|
protected static int |
TOP_RIGHT
Convention index of top-right-end border corners
|
Constructor and Description |
---|
BorderPainter(GraphicsPainter graphicsPainter) |
Modifier and Type | Method and Description |
---|---|
protected static double |
calculateCornerCorrectionFactor(int width,
int height,
BorderProps before,
BorderProps after,
BorderProps start,
BorderProps end)
Calculate the correction factor to handle over-sized elliptic corner radii.
|
protected static double |
calculateCornerScaleCorrection(int width,
int height,
org.apache.fop.render.intermediate.BorderPainter.BorderSegment before,
org.apache.fop.render.intermediate.BorderPainter.BorderSegment after,
org.apache.fop.render.intermediate.BorderPainter.BorderSegment start,
org.apache.fop.render.intermediate.BorderPainter.BorderSegment end)
Calculate the scaling factor to handle over-sized elliptic corner radii.
|
void |
clipBackground(Rectangle rect,
BorderProps bpsBefore,
BorderProps bpsAfter,
BorderProps bpsStart,
BorderProps bpsEnd)
Clip the background to the inner border
|
static float |
dashWidthCalculator(float borderLength,
float borderWidth)
This method calculates the length of the "dash" in a dashed border.
|
void |
drawBorders(Rectangle borderRect,
BorderProps bpsTop,
BorderProps bpsBottom,
BorderProps bpsLeft,
BorderProps bpsRight,
Color innerBackgroundColor)
Draws borders.
|
protected void |
drawRectangularBorders(Rectangle borderRect,
BorderProps bpsTop,
BorderProps bpsBottom,
BorderProps bpsLeft,
BorderProps bpsRight)
TODO merge with drawRoundedBorders()?
|
protected void |
drawRoundedBorders(Rectangle borderRect,
BorderProps beforeBorderProps,
BorderProps afterBorderProps,
BorderProps startBorderProps,
BorderProps endBorderProps)
TODO merge with drawRectangularBorders?
|
protected static final int TOP
protected static final int RIGHT
protected static final int BOTTOM
protected static final int LEFT
protected static final int TOP_LEFT
protected static final int TOP_RIGHT
protected static final int BOTTOM_RIGHT
protected static final int BOTTOM_LEFT
public static final float DASHED_BORDER_SPACE_RATIO
protected static final float DASHED_BORDER_LENGTH_FACTOR
public BorderPainter(GraphicsPainter graphicsPainter)
public void drawBorders(Rectangle borderRect, BorderProps bpsTop, BorderProps bpsBottom, BorderProps bpsLeft, BorderProps bpsRight, Color innerBackgroundColor) throws IFException
borderRect
- the border rectanglebpsTop
- the border specification on the top sidebpsBottom
- the border specification on the bottom sidebpsLeft
- the border specification on the left sidebpsRight
- the border specification on the end sideinnerBackgroundColor
- the inner background colorIFException
- if an error occurs while drawing the bordersprotected void drawRectangularBorders(Rectangle borderRect, BorderProps bpsTop, BorderProps bpsBottom, BorderProps bpsLeft, BorderProps bpsRight) throws IOException
borderRect
- the border rectanglebpsTop
- the border specification on the top sidebpsBottom
- the border specification on the bottom sidebpsLeft
- the border specification on the left sidebpsRight
- the border specification on the end sideIOException
public static float dashWidthCalculator(float borderLength, float borderWidth)
borderLength
- The length of the border.borderWidth
- The width/thickness of the border.protected void drawRoundedBorders(Rectangle borderRect, BorderProps beforeBorderProps, BorderProps afterBorderProps, BorderProps startBorderProps, BorderProps endBorderProps) throws IOException
borderRect
- the border rectangleIOException
- on io exceptionpublic void clipBackground(Rectangle rect, BorderProps bpsBefore, BorderProps bpsAfter, BorderProps bpsStart, BorderProps bpsEnd) throws IOException
rect
- clipping rectanglebpsBefore
- before borderbpsAfter
- after borderbpsStart
- start borderbpsEnd
- end borderIOException
- if an I/O error occursprotected static double calculateCornerCorrectionFactor(int width, int height, BorderProps before, BorderProps after, BorderProps start, BorderProps end)
width
- the border widthheight
- the border heightbefore
- the before border propertiesafter
- the after border propertiesstart
- the start border propertiesend
- the end border propertiesprotected static double calculateCornerScaleCorrection(int width, int height, org.apache.fop.render.intermediate.BorderPainter.BorderSegment before, org.apache.fop.render.intermediate.BorderPainter.BorderSegment after, org.apache.fop.render.intermediate.BorderPainter.BorderSegment start, org.apache.fop.render.intermediate.BorderPainter.BorderSegment end)
width
- the border widthheight
- the border heightbefore
- the before border segmentafter
- the after border segmentstart
- the start border segmentend
- the end border segmentCopyright © 2025 Apache Software Foundation. All rights reserved.