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
ISvgNodeRenderer
implementation for the -
Field Summary
Modifier and TypeFieldDescriptionA List ofPoint
objects representing the path to be drawn by the polyline tagFields inherited from class com.itextpdf.svg.renderers.impl.AbstractSvgNodeRenderer
attributesAndStyles
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCreates a deep copy of this renderer, including it's subtree of childrenprotected void
doDraw
(SvgDrawContext context) Draws this element to a canvas-like object maintained in the context.void
drawMarker
(SvgDrawContext context, MarkerVertexType markerVertexType) Draws a marker in the specified context.double
getAutoOrientAngle
(MarkerSvgNodeRenderer marker, boolean reverse) Calculates marker orientation angle iforient
attribute is set toauto
getObjectBoundingBox
(SvgDrawContext context) Calculates the current object bounding box.protected void
Methods inherited from class com.itextpdf.svg.renderers.impl.AbstractSvgNodeRenderer
canConstructViewPort, canElementFill, deepCopyAttributesAndStyles, draw, getAttribute, getAttributeMapCopy, getAttributeOrDefault, getCurrentFontSize, getParent, parseAbsoluteLength, setAttribute, setAttributesAndStyles, setParent
-
Field Details
-
points
A List ofPoint
objects representing the path to be drawn by the polyline tag
-
-
Constructor Details
-
PolylineSvgNodeRenderer
public PolylineSvgNodeRenderer()
-
-
Method Details
-
getPoints
-
setPoints
Parses a string of space separated x,y pairs into individualPoint
objects and appends them topoints
. Throws anSvgProcessingException
if pointsAttribute does not have a valid list of numerical x,y pairs.- Parameters:
-
pointsAttribute
- A string of space separated x,y value pairs
-
getObjectBoundingBox
Description copied from interface:ISvgNodeRenderer
Calculates the current object bounding box.- Specified by:
-
getObjectBoundingBox
in interfaceISvgNodeRenderer
- Parameters:
-
context
- the current context, for instance it contains current viewport and available font data - Returns:
-
the
Rectangle
representing the current object's bounding box, or null if bounding box is undefined
-
doDraw
Draws this element to a canvas-like object maintained in the context.- Specified by:
-
doDraw
in classAbstractSvgNodeRenderer
- Parameters:
-
context
- the object that knows the place to draw this element and maintains its state
-
createDeepCopy
Description copied from interface:ISvgNodeRenderer
Creates a deep copy of this renderer, including it's subtree of children- Specified by:
-
createDeepCopy
in interfaceISvgNodeRenderer
- Returns:
- deep copy of this renderer
-
drawMarker
Description copied from interface:IMarkerCapable
Draws a marker in the specified context. The marker is drawn on the vertices defined according to the given marker type.- Specified by:
-
drawMarker
in interfaceIMarkerCapable
- Parameters:
-
context
- the object that knows the place to draw this element and maintains its state -
markerVertexType
- type of marker that determine on which vertices of the given element marker should be drawn
-
getAutoOrientAngle
Description copied from interface:IMarkerCapable
Calculates marker orientation angle iforient
attribute is set toauto
- Specified by:
-
getAutoOrientAngle
in interfaceIMarkerCapable
- Parameters:
-
marker
- marker for which the rotation angle should be calculated -
reverse
- 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
-