Package com.itextpdf.svg.renderers.impl
Class RectangleSvgNodeRenderer
- java.lang.Object
-
- com.itextpdf.svg.renderers.impl.AbstractSvgNodeRenderer
-
- com.itextpdf.svg.renderers.impl.RectangleSvgNodeRenderer
-
- All Implemented Interfaces:
ISvgNodeRenderer
public class RectangleSvgNodeRenderer extends AbstractSvgNodeRenderer
ISvgNodeRendererimplementation for the <rect> tag.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.itextpdf.svg.renderers.impl.AbstractSvgNodeRenderer
AbstractSvgNodeRenderer.FillProperties, AbstractSvgNodeRenderer.StrokeProperties
-
-
Field Summary
Fields Modifier and Type Field Description private floatheightprivate floatrxprivate booleanrxPresentprivate floatryprivate booleanryPresentprivate floatwidthprivate floatxprivate floaty-
Fields inherited from class com.itextpdf.svg.renderers.impl.AbstractSvgNodeRenderer
attributesAndStyles, doFill, doStroke
-
-
Constructor Summary
Constructors Constructor Description RectangleSvgNodeRenderer()Constructs a RectangleSvgNodeRenderer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (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.ISvgNodeRenderercreateDeepCopy()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.RectanglegetObjectBoundingBox(SvgDrawContext context)Calculates the current object bounding box.private voidsetParameters(SvgDrawContext context)-
Methods inherited from class com.itextpdf.svg.renderers.impl.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
-
-
-
-
Method Detail
-
doDraw
protected void doDraw(SvgDrawContext context)
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
public Rectangle getObjectBoundingBox(SvgDrawContext context)
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
private void setParameters(SvgDrawContext context)
-
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
public ISvgNodeRenderer createDeepCopy()
Description copied from interface:ISvgNodeRendererCreates a deep copy of this renderer, including it's subtree of children- Returns:
- deep copy of this renderer
-
-