Interface PathMetrics

All Superinterfaces:
Shape
All Known Implementing Classes:
SimplePathMetrics

public interface PathMetrics extends Shape
  • Method Details

    • arcLength

      double arcLength()
      Gets the length of the path.
      Returns:
      the length of the path in [0,Double.MAX_VALUE].
    • getPathIterator

      default PathIterator getPathIterator(@Nullable AffineTransform tx)
      Returns a path iterator of the entire path.
      Specified by:
      getPathIterator in interface Shape
      Parameters:
      tx - an optional transformation for the path iterator
      Returns:
      the path iterator
    • eval

      default @NonNull PointAndDerivative eval(double t)
      Evaluates the path at time t.
      Parameters:
      t - the time in the range [0,1]
      Returns:
      point and tangent at t
    • evalAtArcLength

      @NonNull PointAndDerivative evalAtArcLength(double s)
      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

      Gets path metrics for the reversed path.
      Returns:
      reverse path metrics
    • pathMetricsToString

      static String pathMetricsToString(@NonNull PathMetrics pm)
      Implementations of PathMetrics should implement their toString as 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