- All Superinterfaces:
Shape
- All Known Implementing Classes:
SimplePathMetrics
-
Method Summary
Modifier and TypeMethodDescriptiondoubleGets the length of the path.default @NonNull PointAndDerivativeeval(double t) Evaluates the path at time t.evalAtArcLength(double s) Evaluates the path at the specified arc lengthdefault PathIteratorReturns a path iterator of the entire path.default @NonNull PathIteratorgetSubPathIterator(double t0, double t1, @Nullable AffineTransform tx) Returns a path iterator of the specified sub-path.getSubPathIteratorAtArcLength(double s0, double s1, @Nullable AffineTransform tx) Returns a path iterator over the specified sub-path.booleanisEmpty()Returns true if this path metrics is empty.static StringImplementations of PathMetrics should implement theirtoStringas follows:reverse()Gets path metrics for the reversed path.Methods inherited from interface java.awt.Shape
contains, contains, contains, contains, getBounds, getBounds2D, getPathIterator, intersects, intersects
-
Method Details
-
arcLength
double arcLength()Gets the length of the path.- Returns:
- the length of the path in [0,Double.MAX_VALUE].
-
getPathIterator
Returns a path iterator of the entire path.- Specified by:
getPathIteratorin interfaceShape- Parameters:
tx- an optional transformation for the path iterator- Returns:
- the path iterator
-
eval
Evaluates the path at time t.- Parameters:
t- the time in the range [0,1]- Returns:
- point and tangent at t
-
evalAtArcLength
Evaluates the path at the specified arc length- Parameters:
s- the arc length, the value will be clamped to [0,arcLength()]- Returns:
- point and tangent at s
-
getSubPathIterator
default @NonNull PathIterator getSubPathIterator(double t0, double t1, @Nullable AffineTransform tx) Returns a path iterator of the specified sub-path.- Parameters:
t0- the start time in [0,1].t1- the end time in [0,1].tx- an optional transformation for the path iterator- Returns:
- the path iterator
-
getSubPathIteratorAtArcLength
@NonNull PathIterator getSubPathIteratorAtArcLength(double s0, double s1, @Nullable AffineTransform tx) Returns a path iterator over the specified sub-path.- Parameters:
s0- the arc length at which the sub-path starts, the value will be clamped to [0,arcLength()].s1- the arc length at which the sub-path ends, the value will be clamped to [0,arcLength()].tx- an optional transformation for the path iterator- Returns:
- the path iterator
-
reverse
@NonNull PathMetrics reverse()Gets path metrics for the reversed path.- Returns:
- reverse path metrics
-
pathMetricsToString
Implementations of PathMetrics should implement theirtoStringas follows:public @NonNull toString() { return PathMetrics.pathMetricsToString(this); }- Parameters:
pm- the path metrics implementation- Returns:
- a string representation
-
isEmpty
boolean isEmpty()Returns true if this path metrics is empty.- Returns:
- true if empty
-