Package com.itextpdf.svg.renderers.impl
Class PolylineSvgNodeRenderer
- java.lang.Object
-
- com.itextpdf.svg.renderers.impl.AbstractSvgNodeRenderer
-
- com.itextpdf.svg.renderers.impl.PolylineSvgNodeRenderer
-
- All Implemented Interfaces:
IMarkerCapable,ISvgNodeRenderer
- Direct Known Subclasses:
PolygonSvgNodeRenderer
public class PolylineSvgNodeRenderer extends AbstractSvgNodeRenderer implements IMarkerCapable
ISvgNodeRendererimplementation for the <polyline> 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 protected java.util.List<Point>pointsA List ofPointobjects representing the path to be drawn by the polyline tag.private VectorpreviousOrientationVectorOrientation vector which is used for marker angle calculation.-
Fields inherited from class com.itextpdf.svg.renderers.impl.AbstractSvgNodeRenderer
attributesAndStyles, doFill, doStroke
-
-
Constructor Summary
Constructors Constructor Description PolylineSvgNodeRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.voiddrawMarker(SvgDrawContext context, MarkerVertexType markerVertexType)Draws a marker in the specified context.doublegetAutoOrientAngle(MarkerSvgNodeRenderer marker, boolean reverse)Calculates marker orientation angle iforientattribute is set toautoRectanglegetObjectBoundingBox(SvgDrawContext context)Calculates the current object bounding box.protected java.util.List<Point>getPoints()Returns a list ofPointobjects representing the path to be drawn by the polyline tag.protected voidsetPoints(java.lang.String pointsAttribute)-
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
-
getPoints
protected java.util.List<Point> getPoints()
Returns a list ofPointobjects representing the path to be drawn by the polyline tag.- Returns:
- a list of
Pointobjects
-
setPoints
protected void setPoints(java.lang.String pointsAttribute)
Parses a string of space separated x,y pairs into individualPointobjects and appends them topoints. Throws anSvgProcessingExceptionif pointsAttribute does not have a valid list of numerical x,y pairs.- Parameters:
pointsAttribute- A string of space separated x,y value pairs
-
getObjectBoundingBox
public Rectangle getObjectBoundingBox(SvgDrawContext context)
Description copied from interface:ISvgNodeRendererCalculates the current object bounding box.- Specified by:
getObjectBoundingBoxin interfaceISvgNodeRenderer- 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
-
doDraw
protected void doDraw(SvgDrawContext context)
Draws 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
-
createDeepCopy
public ISvgNodeRenderer createDeepCopy()
Description copied from interface:ISvgNodeRendererCreates a deep copy of this renderer, including it's subtree of children- Specified by:
createDeepCopyin interfaceISvgNodeRenderer- Returns:
- deep copy of this renderer
-
drawMarker
public void drawMarker(SvgDrawContext context, MarkerVertexType markerVertexType)
Description copied from interface:IMarkerCapableDraws a marker in the specified context. The marker is drawn on the vertices defined according to the given marker type.- Specified by:
drawMarkerin interfaceIMarkerCapable- Parameters:
context- the object that knows the place to draw this element and maintains its statemarkerVertexType- type of marker that determine on which vertices of the given element marker should be drawn
-
getAutoOrientAngle
public double getAutoOrientAngle(MarkerSvgNodeRenderer marker, boolean reverse)
Description copied from interface:IMarkerCapableCalculates marker orientation angle iforientattribute is set toauto- Specified by:
getAutoOrientAnglein interfaceIMarkerCapable- Parameters:
marker- marker for which the rotation angle should be calculatedreverse- indicates that the resulting angle should be rotated 180 degrees- Returns:
- marker orientation angle so that its positive x-axis is pointing in the direction of the path at the point it is placed
-
-