1 18 package org.apache.batik.gvt.text; 19 20 import java.awt.geom.GeneralPath ; 21 import java.awt.geom.Point2D ; 22 23 import org.apache.batik.ext.awt.geom.PathLength; 24 25 31 public class TextPath { 32 33 private PathLength pathLength; 34 private float startOffset; 35 36 41 public TextPath(GeneralPath path) { 42 pathLength = new PathLength(path); 43 startOffset = 0; 44 } 45 46 51 public void setStartOffset(float startOffset) { 52 this.startOffset = startOffset; 53 } 54 55 60 public float getStartOffset() { 61 return startOffset; 62 } 63 64 69 public float lengthOfPath() { 70 return pathLength.lengthOfPath(); 71 } 72 73 80 public float angleAtLength(float length) { 81 return pathLength.angleAtLength(length); 82 } 83 84 91 public Point2D pointAtLength(float length) { 92 return pathLength.pointAtLength(length); 93 } 94 } 95 | Popular Tags |