Package com.itextpdf.svg.renderers.impl
Class LineSvgNodeRenderer
- java.lang.Object
-
- com.itextpdf.svg.renderers.impl.AbstractSvgNodeRenderer
-
- com.itextpdf.svg.renderers.impl.LineSvgNodeRenderer
-
- All Implemented Interfaces:
IMarkerCapable
,ISvgNodeRenderer
public class LineSvgNodeRenderer extends AbstractSvgNodeRenderer implements IMarkerCapable
ISvgNodeRenderer
implementation for the <line> tag.
-
-
Field Summary
Fields Modifier and Type Field Description private float
x1
private float
x2
private float
y1
private float
y2
-
Fields inherited from class com.itextpdf.svg.renderers.impl.AbstractSvgNodeRenderer
attributesAndStyles, doFill, doStroke, partOfClipPath
-
-
Constructor Summary
Constructors Constructor Description LineSvgNodeRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canElementFill()
Method to see if a certain renderer can use fill.ISvgNodeRenderer
createDeepCopy()
Creates a deep copy of this renderer, including it's subtree of childrenvoid
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.(package private) float
getAttribute(java.util.Map<java.lang.String,java.lang.String> attributes, java.lang.String key)
double
getAutoOrientAngle(MarkerSvgNodeRenderer marker, boolean reverse)
Calculates marker orientation angle iforient
attribute is set toauto
Rectangle
getObjectBoundingBox(SvgDrawContext context)
Calculates the current object bounding box.private boolean
setParameterss()
-
Methods inherited from class com.itextpdf.svg.renderers.impl.AbstractSvgNodeRenderer
calculateViewPortTranslation, canConstructViewPort, deepCopyAttributesAndStyles, draw, getAttribute, getAttributeMapCopy, getAttributeOrDefault, getCurrentFontSize, getParent, parseAbsoluteLength, postDraw, preDraw, setAttribute, setAttributesAndStyles, setParent, setPartOfClipPath
-
-
-
-
Method Detail
-
doDraw
public void doDraw(SvgDrawContext context)
Description copied from class:AbstractSvgNodeRenderer
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
-
getObjectBoundingBox
public Rectangle getObjectBoundingBox(SvgDrawContext context)
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
-
canElementFill
protected boolean canElementFill()
Description copied from class:AbstractSvgNodeRenderer
Method to see if a certain renderer can use fill.- Overrides:
canElementFill
in classAbstractSvgNodeRenderer
- Returns:
- true if the renderer can use fill
-
getAttribute
float getAttribute(java.util.Map<java.lang.String,java.lang.String> attributes, java.lang.String key)
-
createDeepCopy
public ISvgNodeRenderer 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
public void drawMarker(SvgDrawContext context, MarkerVertexType markerVertexType)
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 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: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 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
-
setParameterss
private boolean setParameterss()
-
-