org.apache.batik.ext.awt.geom
Class Linear
java.lang.Object
org.apache.batik.ext.awt.geom.Linear
- All Implemented Interfaces:
- java.lang.Cloneable, Segment
public class Linear
- extends java.lang.Object
- implements Segment
A class representing a linear path segment.
Field Summary |
java.awt.geom.Point2D.Double |
p1
|
java.awt.geom.Point2D.Double |
p2
|
Constructor Summary |
Linear()
|
Linear(double x1,
double y1,
double x2,
double y2)
|
Linear(java.awt.geom.Point2D.Double p1,
java.awt.geom.Point2D.Double p2)
|
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
p1
public java.awt.geom.Point2D.Double p1
p2
public java.awt.geom.Point2D.Double p2
Linear
public Linear()
Linear
public Linear(double x1,
double y1,
double x2,
double y2)
Linear
public Linear(java.awt.geom.Point2D.Double p1,
java.awt.geom.Point2D.Double p2)
clone
public java.lang.Object clone()
- Overrides:
clone
in class java.lang.Object
reverse
public Segment reverse()
minX
public double minX()
- Specified by:
minX
in interface Segment
maxX
public double maxX()
- Specified by:
maxX
in interface Segment
minY
public double minY()
- Specified by:
minY
in interface Segment
maxY
public double maxY()
- Specified by:
maxY
in interface Segment
getBounds2D
public java.awt.geom.Rectangle2D getBounds2D()
- Specified by:
getBounds2D
in interface Segment
evalDt
public java.awt.geom.Point2D.Double evalDt(double t)
- Specified by:
evalDt
in interface Segment
eval
public java.awt.geom.Point2D.Double eval(double t)
- Specified by:
eval
in interface Segment
split
public Segment.SplitResults split(double y)
- Specified by:
split
in interface Segment
getSegment
public Segment getSegment(double t0,
double t1)
- Specified by:
getSegment
in interface Segment
splitBefore
public Segment splitBefore(double t)
- Specified by:
splitBefore
in interface Segment
splitAfter
public Segment splitAfter(double t)
- Specified by:
splitAfter
in interface Segment
subdivide
public void subdivide(Segment s0,
Segment s1)
- Subdivides this Linear segment into two segments at t = 0.5.
can be done with getSegment but this is more efficent.
- Specified by:
subdivide
in interface Segment
- Parameters:
s0
- if non-null contains portion of curve from 0->.5s1
- if non-null contains portion of curve from .5->1
subdivide
public void subdivide(double t,
Segment s0,
Segment s1)
- Subdivides this Linear segment into two segments at given t.
- Specified by:
subdivide
in interface Segment
- Parameters:
s0
- if non-null contains portion of curve from 0->t.s1
- if non-null contains portion of curve from t->1.
subdivide
public void subdivide(Linear l0,
Linear l1)
- Subdivides this Cubic curve into two curves at t = 0.5.
Can be done with getSegment but this is more efficent.
- Parameters:
l0
- if non-null contains portion of curve from 0->.5l1
- if non-null contains portion of curve from .5->1
subdivide
public void subdivide(double t,
Linear l0,
Linear l1)
- Subdivides this Cubic curve into two curves.
Can be done with getSegment but this is more efficent.
- Parameters:
t
- position to split the curvel0
- if non-null contains portion of curve from 0->tl1
- if non-null contains portion of curve from t->1
getLength
public double getLength()
- Specified by:
getLength
in interface Segment
getLength
public double getLength(double maxErr)
- Specified by:
getLength
in interface Segment
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright ? 2008 Apache Software Foundation. All Rights Reserved.