Package org.jfree.chart.util
Class GeomUtil
- java.lang.Object
-
- org.jfree.chart.util.GeomUtil
-
public final class GeomUtil extends java.lang.ObjectSome utility methods for working with geometry in Java2D.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateGeomUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.awt.geom.Point2DcalculateIntersectionPoint(java.awt.geom.Line2D lineA, java.awt.geom.Line2D lineB)Calculates the intersection point oflineAwithlineB, possiblynullif no intersection point exists (i.e.static java.awt.geom.Point2D[]calculateIntersectionPoints(java.awt.geom.Line2D lineA, java.awt.geom.Line2D... lines)For each line inlines, calculates its intersection point withlineA, possibly no intersection point exists (i.e.static java.awt.geom.Line2D[]getLines(java.awt.Shape shape, java.awt.geom.AffineTransform at)Returns allline segmentsbuilding up ashape.
-
-
-
Method Detail
-
calculateIntersectionPoints
public static java.awt.geom.Point2D[] calculateIntersectionPoints(java.awt.geom.Line2D lineA, java.awt.geom.Line2D... lines)For each line inlines, calculates its intersection point withlineA, possibly no intersection point exists (i.e. parallel lines).- Parameters:
lineA- line to calculate the intersection point for.lines- lines to calculate the intersection points with.- Returns:
- all intersections points between
lineAandlines. - See Also:
calculateIntersectionPoint(Line2D, Line2D)
-
calculateIntersectionPoint
public static java.awt.geom.Point2D calculateIntersectionPoint(java.awt.geom.Line2D lineA, java.awt.geom.Line2D lineB)Calculates the intersection point oflineAwithlineB, possiblynullif no intersection point exists (i.e. parallel lines).- Parameters:
lineA- the first line for the calculationlineB- the second line for the calculation- Returns:
- the intersection point of
lineAwithlineB, possiblynullif no intersection point exists
-
getLines
public static java.awt.geom.Line2D[] getLines(java.awt.Shape shape, java.awt.geom.AffineTransform at) throws java.lang.IllegalArgumentExceptionReturns allline segmentsbuilding up ashape.- Parameters:
shape- a shape that is built up ofPathIterator.SEG_LINETOelements.at- an optionalAffineTransformto be applied to the coordinates as they are returned in the iteration, ornullif untransformed coordinates are desired- Returns:
- all
line segmentsbuilding up theshape - Throws:
java.lang.IllegalArgumentException- ifshapecontains non-straight line segments (i.e.PathIterator.SEG_CUBICTOorPathIterator.SEG_QUADTO)
-
-