Class TextPath


  • public class TextPath
    extends java.lang.Object
    A text path describes a path along which some text will be rendered.
    Version:
    $Id: TextPath.java 1733416 2016-03-03 07:07:13Z gadams $
    • Constructor Summary

      Constructors 
      Constructor Description
      TextPath​(java.awt.geom.GeneralPath path)
      Constructs a TextPath based on the specified path.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      float angleAtLength​(float length)
      Returns the angle at the specified length along the path.
      float getStartOffset()
      Returns the start offset of this text path.
      float lengthOfPath()
      Returns the total length of the path.
      java.awt.geom.Point2D pointAtLength​(float length)
      Returns the point that is at the specified length along the path.
      void setStartOffset​(float startOffset)
      Sets the offset along the path where the first glyph should be rendered.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • startOffset

        private float startOffset
    • Constructor Detail

      • TextPath

        public TextPath​(java.awt.geom.GeneralPath path)
        Constructs a TextPath based on the specified path.
        Parameters:
        path - The general path along which text is to be laid.
    • Method Detail

      • setStartOffset

        public void setStartOffset​(float startOffset)
        Sets the offset along the path where the first glyph should be rendered.
        Parameters:
        startOffset - An offset from the start of the path.
      • getStartOffset

        public float getStartOffset()
        Returns the start offset of this text path.
        Returns:
        The start offset of this text path.
      • lengthOfPath

        public float lengthOfPath()
        Returns the total length of the path.
        Returns:
        The lenght of the path.
      • angleAtLength

        public float angleAtLength​(float length)
        Returns the angle at the specified length along the path.
        Parameters:
        length - The length along the path.
        Returns:
        The angle.
      • pointAtLength

        public java.awt.geom.Point2D pointAtLength​(float length)
        Returns the point that is at the specified length along the path.
        Parameters:
        length - The length along the path.
        Returns:
        The point.