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
ISvgNodeRenderer implementation for the <marker> tag.-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractSvgNodeRenderer
AbstractSvgNodeRenderer.FillProperties, AbstractSvgNodeRenderer.StrokeProperties -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final floatprivate static final floatprivate static final floatprivate static final floatstatic final StringAttribute defining the marker index on polygon, line or polyline.Fields inherited from class AbstractBranchSvgNodeRenderer
VIEWBOX_VALUES_NUMBERFields inherited from class AbstractSvgNodeRenderer
attributesAndStyles, doFill, doStroke -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void(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.Creates a deep copy of this renderer, including it's subtree of children(package private) static voiddrawMarker(SvgDrawContext context, String moveX, String moveY, MarkerVertexType markerToUse, AbstractSvgNodeRenderer parent) (package private) static voiddrawMarkers(SvgDrawContext context, int startIndex, List<Point> markerPoints, MarkerVertexType markerToUse, AbstractSvgNodeRenderer parent) private float[]getObjectBoundingBox(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 AbstractBranchSvgNodeRenderer
addChild, calculateAndApplyViewBox, deepCopyChildren, doDraw, getChildren, postDrawMethods inherited from class AbstractSvgNodeRenderer
applyFillAndStrokeProperties, applyNonScalingStrokeTransform, calculateViewPortTranslation, canConstructViewPort, canElementFill, deepCopyAttributesAndStyles, doStrokeOrFill, draw, getAttribute, getAttributeMapCopy, getAttributeOrDefault, getCurrentFontSize, getCurrentFontSize, getCurrentViewBox, getParent, getParentClipPath, parseAbsoluteLength, parseHorizontalLength, parseVerticalLength, retrieveAlignAndMeet, setAttribute, setAttributesAndStyles, setParentMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ISvgNodeRenderer
draw, getAttribute, getAttributeMapCopy, getParent, setAttribute, setAttributesAndStyles, setParent
-
Field Details
-
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:
-
DEFAULT_MARKER_WIDTH
private static final float DEFAULT_MARKER_WIDTH- See Also:
-
DEFAULT_MARKER_HEIGHT
private static final float DEFAULT_MARKER_HEIGHT- See Also:
-
DEFAULT_REF_X
private static final float DEFAULT_REF_X- See Also:
-
DEFAULT_REF_Y
private static final float DEFAULT_REF_Y- See Also:
-
-
Constructor Details
-
MarkerSvgNodeRenderer
public MarkerSvgNodeRenderer()
-
-
Method Details
-
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
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
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
-
drawMarker
static void drawMarker(SvgDrawContext context, String moveX, String moveY, MarkerVertexType markerToUse, AbstractSvgNodeRenderer parent) -
drawMarkers
static void drawMarkers(SvgDrawContext context, int startIndex, List<Point> markerPoints, MarkerVertexType markerToUse, AbstractSvgNodeRenderer parent) -
applyViewBox
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
-
applyRotation
-
applyUserSpaceScaling
-
applyCoordinatesTranslation
-
getViewBoxValues
private float[] getViewBoxValues(float defaultWidth, float defaultHeight)
-