Package com.itextpdf.svg.renderers.impl
Class MarkerSvgNodeRenderer
- java.lang.Object
-
- com.itextpdf.svg.renderers.impl.AbstractSvgNodeRenderer
-
- com.itextpdf.svg.renderers.impl.AbstractBranchSvgNodeRenderer
-
- com.itextpdf.svg.renderers.impl.MarkerSvgNodeRenderer
-
- All Implemented Interfaces:
IBranchSvgNodeRenderer,ISvgNodeRenderer
public class MarkerSvgNodeRenderer extends AbstractBranchSvgNodeRenderer
ISvgNodeRendererimplementation for the <marker> 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 static floatDEFAULT_MARKER_HEIGHTprivate static floatDEFAULT_MARKER_WIDTHprivate static floatDEFAULT_REF_Xprivate static floatDEFAULT_REF_Ystatic java.lang.StringMARKER_INDEXAttribute defining the marker index on polygon, line or polyline.-
Fields inherited from class com.itextpdf.svg.renderers.impl.AbstractBranchSvgNodeRenderer
VIEWBOX_VALUES_NUMBER
-
Fields inherited from class com.itextpdf.svg.renderers.impl.AbstractSvgNodeRenderer
attributesAndStyles, doFill, doStroke
-
-
Constructor Summary
Constructors Constructor Description MarkerSvgNodeRenderer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidapplyCoordinatesTranslation(SvgDrawContext context)(package private) voidapplyMarkerAttributes(SvgDrawContext context)private voidapplyRotation(SvgDrawContext context)private voidapplyUserSpaceScaling(SvgDrawContext context)protected voidapplyViewBox(SvgDrawContext context)Applies a transformation based on a viewBox for a given branch node.ISvgNodeRenderercreateDeepCopy()Creates a deep copy of this renderer, including it's subtree of children(package private) static voiddrawMarker(SvgDrawContext context, java.lang.String moveX, java.lang.String moveY, MarkerVertexType markerToUse, AbstractSvgNodeRenderer parent)(package private) static voiddrawMarkers(SvgDrawContext context, int startIndex, java.util.List<Point> markerPoints, MarkerVertexType markerToUse, AbstractSvgNodeRenderer parent)private float[]getMarkerWidthHeightValues()RectanglegetObjectBoundingBox(SvgDrawContext context)Calculates the current object bounding box.private float[]getViewBoxValues(float defaultWidth, float defaultHeight)protected booleanisHidden()Check if this renderer should draw the element based on its attributes (e.g.private static booleanmarkerWidthHeightAreCorrect(MarkerSvgNodeRenderer namedObject)(package private) voidpreDraw(SvgDrawContext context)Operations to perform before drawing an element.-
Methods inherited from class com.itextpdf.svg.renderers.impl.AbstractBranchSvgNodeRenderer
addChild, calculateAndApplyViewBox, deepCopyChildren, doDraw, getChildren, postDraw
-
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, parseAbsoluteLength, parseHorizontalLength, parseVerticalLength, retrieveAlignAndMeet, setAttribute, setAttributesAndStyles, setParent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.itextpdf.svg.renderers.ISvgNodeRenderer
draw, getAttribute, getAttributeMapCopy, getParent, setAttribute, setAttributesAndStyles, setParent
-
-
-
-
Field Detail
-
MARKER_INDEX
public static final java.lang.String MARKER_INDEX
Attribute defining the marker index on polygon, line or polyline. It is not a property from css standard, used for internal marker processing.- See Also:
- Constant Field Values
-
DEFAULT_MARKER_WIDTH
private static final float DEFAULT_MARKER_WIDTH
- See Also:
- Constant Field Values
-
DEFAULT_MARKER_HEIGHT
private static final float DEFAULT_MARKER_HEIGHT
- See Also:
- Constant Field Values
-
DEFAULT_REF_X
private static final float DEFAULT_REF_X
- See Also:
- Constant Field Values
-
DEFAULT_REF_Y
private static final float DEFAULT_REF_Y
- See Also:
- Constant Field Values
-
-
Method Detail
-
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- Specified by:
createDeepCopyin classAbstractBranchSvgNodeRenderer- Returns:
- deep copy of this renderer
-
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
-
isHidden
protected boolean isHidden()
Description copied from class:AbstractSvgNodeRendererCheck if this renderer should draw the element based on its attributes (e.g. visibility/display)- Overrides:
isHiddenin classAbstractSvgNodeRenderer- Returns:
- true if element won't be drawn, false otherwise
-
preDraw
void preDraw(SvgDrawContext context)
Description copied from class:AbstractSvgNodeRendererOperations to perform before drawing an element. This includes setting stroke color and width, fill color.- Overrides:
preDrawin classAbstractSvgNodeRenderer- Parameters:
context- the svg draw context
-
applyMarkerAttributes
void applyMarkerAttributes(SvgDrawContext context)
-
drawMarker
static void drawMarker(SvgDrawContext context, java.lang.String moveX, java.lang.String moveY, MarkerVertexType markerToUse, AbstractSvgNodeRenderer parent)
-
drawMarkers
static void drawMarkers(SvgDrawContext context, int startIndex, java.util.List<Point> markerPoints, MarkerVertexType markerToUse, AbstractSvgNodeRenderer parent)
-
applyViewBox
protected void applyViewBox(SvgDrawContext context)
Description copied from class:AbstractBranchSvgNodeRendererApplies a transformation based on a viewBox for a given branch node.- Overrides:
applyViewBoxin classAbstractBranchSvgNodeRenderer- Parameters:
context- current svg draw context
-
getMarkerWidthHeightValues
private float[] getMarkerWidthHeightValues()
-
markerWidthHeightAreCorrect
private static boolean markerWidthHeightAreCorrect(MarkerSvgNodeRenderer namedObject)
-
applyRotation
private void applyRotation(SvgDrawContext context)
-
applyUserSpaceScaling
private void applyUserSpaceScaling(SvgDrawContext context)
-
applyCoordinatesTranslation
private void applyCoordinatesTranslation(SvgDrawContext context)
-
getViewBoxValues
private float[] getViewBoxValues(float defaultWidth, float defaultHeight)
-
-