Class RectangleSvgNodeRenderer
java.lang.Object
com.itextpdf.svg.renderers.impl.AbstractSvgNodeRenderer
com.itextpdf.svg.renderers.impl.RectangleSvgNodeRenderer
- All Implemented Interfaces:
ISvgNodeRenderer
ISvgNodeRenderer implementation for the <rect> tag.-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractSvgNodeRenderer
AbstractSvgNodeRenderer.FillProperties, AbstractSvgNodeRenderer.StrokeProperties -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate floatprivate floatprivate booleanprivate floatprivate booleanprivate floatprivate floatprivate floatFields inherited from class AbstractSvgNodeRenderer
attributesAndStyles, doFill, doStroke -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) floatcheckRadius(float radius, float distance) a radius must be positive, and cannot be more than half the distance in the dimension it is for.Creates a deep copy of this renderer, including it's subtree of childrenprotected voiddoDraw(SvgDrawContext context) Draws this element to a canvas-like object maintained in the context.(package private) floatfindCircularRadius(float rx, float ry, float width, float height) In case of a circular radius, the calculation incheckRadius(float, float)isn't enough: the radius cannot be more than half of the smallest dimension.getObjectBoundingBox(SvgDrawContext context) Calculates the current object bounding box.private voidsetParameters(SvgDrawContext context) Methods inherited from class AbstractSvgNodeRenderer
applyFillAndStrokeProperties, applyNonScalingStrokeTransform, calculateViewPortTranslation, canConstructViewPort, canElementFill, deepCopyAttributesAndStyles, doStrokeOrFill, draw, getAttribute, getAttributeMapCopy, getAttributeOrDefault, getCurrentFontSize, getCurrentFontSize, getCurrentViewBox, getParent, getParentClipPath, isHidden, parseAbsoluteLength, parseHorizontalLength, parseVerticalLength, postDraw, preDraw, retrieveAlignAndMeet, setAttribute, setAttributesAndStyles, setParent
-
Field Details
-
x
private float x -
y
private float y -
width
private float width -
height
private float height -
rxPresent
private boolean rxPresent -
ryPresent
private boolean ryPresent -
rx
private float rx -
ry
private float ry
-
-
Constructor Details
-
RectangleSvgNodeRenderer
public RectangleSvgNodeRenderer()Constructs a RectangleSvgNodeRenderer.
-
-
Method Details
-
doDraw
Description copied from class:AbstractSvgNodeRendererDraws this element to a canvas-like object maintained in the context.- Specified by:
doDrawin classAbstractSvgNodeRenderer- Parameters:
context- the object that knows the place to draw this element and maintains its state
-
getObjectBoundingBox
Description copied from interface:ISvgNodeRendererCalculates the current object bounding box.- Parameters:
context- the current context, for instance it contains current viewport and available font data- Returns:
- the
Rectanglerepresenting the current object's bounding box, or null if bounding box is undefined
-
setParameters
-
checkRadius
float checkRadius(float radius, float distance) a radius must be positive, and cannot be more than half the distance in the dimension it is for. e.g. rx <= width / 2 -
findCircularRadius
float findCircularRadius(float rx, float ry, float width, float height) In case of a circular radius, the calculation incheckRadius(float, float)isn't enough: the radius cannot be more than half of the smallest dimension. This method assumes thatcheckRadius(float, float)has already run, and it is silently assumed (though not necessary for this method) that eitherrxorryis zero. -
createDeepCopy
Description copied from interface:ISvgNodeRendererCreates a deep copy of this renderer, including it's subtree of children- Returns:
- deep copy of this renderer
-