Class AbstractPathShape
- java.lang.Object
-
- com.itextpdf.svg.renderers.path.impl.AbstractPathShape
-
- All Implemented Interfaces:
IPathShape
- Direct Known Subclasses:
CurveTo
,EllipticalCurveTo
,LineTo
,MoveTo
,QuadraticCurveTo
public abstract class AbstractPathShape extends java.lang.Object implements IPathShape
This class handles common behaviour in IPathShape implementations
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String[]
coordinates
protected IOperatorConverter
copier
protected java.util.Map<java.lang.String,java.lang.String>
properties
The properties of this shape.protected boolean
relative
Whether this is a relative operator or not.
-
Constructor Summary
Constructors Constructor Description AbstractPathShape()
AbstractPathShape(boolean relative)
AbstractPathShape(boolean relative, IOperatorConverter copier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Point
createPoint(java.lang.String coordX, java.lang.String coordY)
Point
getEndingPoint()
Gets the ending point on the canvas after the path shape has been drawn via theIPathShape.draw(PdfCanvas)
method, in SVG space coordinates.Rectangle
getPathShapeRectangle(Point lastPoint)
Get bounding rectangle of the current path shape.boolean
isRelative()
Returns true when this shape is a relative operator.-
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.path.IPathShape
draw, setCoordinates
-
-
-
-
Field Detail
-
properties
protected java.util.Map<java.lang.String,java.lang.String> properties
The properties of this shape.
-
relative
protected boolean relative
Whether this is a relative operator or not.
-
copier
protected final IOperatorConverter copier
-
coordinates
protected java.lang.String[] coordinates
-
-
Constructor Detail
-
AbstractPathShape
public AbstractPathShape()
-
AbstractPathShape
public AbstractPathShape(boolean relative)
-
AbstractPathShape
public AbstractPathShape(boolean relative, IOperatorConverter copier)
-
-
Method Detail
-
isRelative
public boolean isRelative()
Description copied from interface:IPathShape
Returns true when this shape is a relative operator. False if it is an absolute operator.- Specified by:
isRelative
in interfaceIPathShape
- Returns:
- true if relative, false if absolute
-
createPoint
protected Point createPoint(java.lang.String coordX, java.lang.String coordY)
-
getEndingPoint
public Point getEndingPoint()
Description copied from interface:IPathShape
Gets the ending point on the canvas after the path shape has been drawn via theIPathShape.draw(PdfCanvas)
method, in SVG space coordinates.- Specified by:
getEndingPoint
in interfaceIPathShape
- Returns:
- The
Point
representing the final point in the drawn path. If the point does not exist or does not changenull
may be returned.
-
getPathShapeRectangle
public Rectangle getPathShapeRectangle(Point lastPoint)
Get bounding rectangle of the current path shape.- Specified by:
getPathShapeRectangle
in interfaceIPathShape
- Parameters:
lastPoint
- start point for this shape- Returns:
- calculated rectangle
-
-