|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.batik.ext.awt.geom.PathLength
PathLength is a utility class for calculating the length of a path, the location of a point at a particular length along the path, and the angle of the tangent to the path at a given length.
It uses a FlatteningPathIterator to create a flattened version of the Path. This means the values returned are not always exact (in fact, they rarely are), but in most cases they are reasonably accurate.
Nested Class Summary | |
---|---|
protected class |
PathLength.PathSegment
|
Constructor Summary | |
---|---|
PathLength(java.awt.Shape path)
Construct a PathLength utility class to operate on the particular Shape. |
Method Summary | |
---|---|
float |
angleAtLength(float length)
|
java.awt.Shape |
getPath()
Get the path to use in calculations. |
protected void |
initialise()
|
float |
lengthOfPath()
Returns the length of the path used by this PathLength object. |
static void |
main(java.lang.String[] args)
|
java.awt.geom.Point2D |
pointAtLength(float length)
Return the point that is at the given length along the path. |
void |
setPath(java.awt.Shape v)
Set the path to use in calculations. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PathLength(java.awt.Shape path)
path
- The Path (or Shape) to use.Method Detail |
public java.awt.Shape getPath()
public void setPath(java.awt.Shape v)
v
- Path to be used in calculations.public float lengthOfPath()
protected void initialise()
public java.awt.geom.Point2D pointAtLength(float length)
length
- The length along the path
public float angleAtLength(float length)
public static void main(java.lang.String[] args)
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |