API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.awt.geom. Line2D View Source
Author(s)
Jim Graham
Since
1.2
Version
1.31, 02/24/06
Serial
Hierarchy
 Object
      Line2D
Implements
 Shape
 Cloneable
Subclasses
Description
publicabstract abstract class Line2D
  This Line2D represents a line segment in (x,y) coordinate space.
See also:   
Constructors
protected Line2D ()
  This is an abstract class that cannot be instantiated directly.
Methods
Hide/Show inherited methods
public Object clone ()
  Creates a new object of the same class as this object.
public boolean contains (double x, double y) [Specified in Shape]
  Tests if a specified coordinate is inside the boundary of this Line2D.
public boolean contains (double x, double y, double w, double h) [Specified in Shape]
  Tests if the interior of this Line2D entirely contains the specified set of rectangular coordinates.
public boolean contains (Point2D p) [Specified in Shape]
  Tests if a given Point2D is inside the boundary of this Line2D.
public boolean contains (Rectangle2D r) [Specified in Shape]
  Tests if the interior of this Line2D entirely contains the specified Rectangle2D.
public Rectangle getBounds () [Specified in Shape]
  Returns an integer Rectangle that completely encloses the Shape.
publicabstract Point2D getP1 ()
  Returns the start Point2D of this Line2D.
publicabstract Point2D getP2 ()
  Returns the end Point2D of this Line2D.
public PathIterator getPathIterator (AffineTransform at) [Specified in Shape]
  Returns an iteration object that defines the boundary of this Line2D.
public PathIterator getPathIterator (AffineTransform at, double flatness) [Specified in Shape]
  Returns an iteration object that defines the boundary of this flattened Line2D.
publicabstract double getX1 ()
  Returns the X coordinate of the start point in double precision.
publicabstract double getX2 ()
  Returns the X coordinate of the end point in double precision.
publicabstract double getY1 ()
  Returns the Y coordinate of the start point in double precision.
publicabstract double getY2 ()
  Returns the Y coordinate of the end point in double precision.
public boolean intersects (double x, double y, double w, double h) [Specified in Shape]
  Tests if the interior of the Shape intersects the interior of a specified rectangular area.
public boolean intersects (Rectangle2D r) [Specified in Shape]
  Tests if the interior of the Shape intersects the interior of a specified Rectangle2D.
public boolean intersectsLine (double x1, double y1, double x2, double y2)
  Tests if the line segment from (x1,y1) to (x2,y2) intersects this line segment.
public boolean intersectsLine (Line2D l)
  Tests if the specified line segment intersects this line segment.
publicstatic boolean linesIntersect (double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
  Tests if the line segment from (x1,y1) to (x2,y2) intersects the line segment from (x3,y3) to (x4,y4).
public double ptLineDist (double px, double py)
  Returns the distance from a point to this line.
publicstatic double ptLineDist (double x1, double y1, double x2, double y2, double px, double py)
  Returns the distance from a point to a line.
public double ptLineDist (Point2D pt)
  Returns the distance from a Point2D to this line.
public double ptLineDistSq (double px, double py)
  Returns the square of the distance from a point to this line.
publicstatic double ptLineDistSq (double x1, double y1, double x2, double y2, double px, double py)
  Returns the square of the distance from a point to a line.
public double ptLineDistSq (Point2D pt)
  Returns the square of the distance from a specified Point2D to this line.
public double ptSegDist (double px, double py)
  Returns the distance from a point to this line segment.
publicstatic double ptSegDist (double x1, double y1, double x2, double y2, double px, double py)
  Returns the distance from a point to a line segment.
public double ptSegDist (Point2D pt)
  Returns the distance from a Point2D to this line segment.
public double ptSegDistSq (double px, double py)
  Returns the square of the distance from a point to this line segment.
publicstatic double ptSegDistSq (double x1, double y1, double x2, double y2, double px, double py)
  Returns the square of the distance from a point to a line segment.
public double ptSegDistSq (Point2D pt)
  Returns the square of the distance from a Point2D to this line segment.
public int relativeCCW (double px, double py)
  Returns an indicator of where the specified point (px,py) lies with respect to this line segment.
publicstatic int relativeCCW (double x1, double y1, double x2, double y2, double px, double py)
  Returns an indicator of where the specified point (px,py) lies with respect to the line segment from (x1,y1) to (x2,y2).
public int relativeCCW (Point2D p)
  Returns an indicator of where the specified Point2D lies with respect to this line segment.
publicabstract void setLine (double x1, double y1, double x2, double y2)
  Sets the location of the end points of this Line2D to the specified double coordinates.
public void setLine (Line2D l)
  Sets the location of the end points of this Line2D to the same as those end points of the specified Line2D.
public void setLine (Point2D p1, Point2D p2)
  Sets the location of the end points of this Line2D to the specified Point2D coordinates.
Fields
Hide/Show inherited fields
Nested Classes
  Line2D.Float
A line segment specified with float coordinates.
  Line2D.Double
A line segment specified with double coordinates.
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar