Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.awt.geom

Class Line2D.Float

java.lang.Object
|
+--java.awt.geom.Line2D
   |
   +--java.awt.geom.Line2D.Float


public static class Line2D.Float

extends Line2D

This class defines a point in float precision.

Since:Author:

Field Summary

floatx1

The x coordinate of the first point.
floatx2

The x coordinate of the second point.
floaty1

The y coordinate of the first point.
floaty2

The y coordinate of the second point.

Constructor Summary

Float()

Construct the line segment (0,0)->(0,0).
Float(float x1, float y1, float x2, float y2)

Construct the line segment with the specified points.
Float(java.awt.geom.Point2D p1, java.awt.geom.Point2D p2)

Construct the line segment with the specified points.

Method Summary

java.awt.geom.Rectangle2DgetBounds2D()

Return the exact bounds of this line segment.
java.awt.geom.Point2DgetP1()

Return the first point.
java.awt.geom.Point2DgetP2()

Return the second point.
doublegetX1()

Return the x coordinate of the first point.
doublegetX2()

Return the x coordinate of the second point.
doublegetY1()

Return the y coordinate of the first point.
doublegetY2()

Return the y coordinate of the second point.
voidsetLine(double x1, double y1, double x2, double y2)

Set this line to the given points.
voidsetLine(float x1, float y1, float x2, float y2)

Set this line to the given points.

Field Details

x1

public float x1

The x coordinate of the first point.


x2

public float x2

The x coordinate of the second point.


y1

public float y1

The y coordinate of the first point.


y2

public float y2

The y coordinate of the second point.


Constructor Details

Float

public Float()

Construct the line segment (0,0)->(0,0).


Float

public Float(float x1, float y1, float x2, float y2)

Construct the line segment with the specified points.

Parameters:


Float

public Float(java.awt.geom.Point2D p1, java.awt.geom.Point2D p2)

Construct the line segment with the specified points.

Parameters:

Throws:


Method Details

getBounds2D

public Rectangle2D getBounds2D()

Return the exact bounds of this line segment.

Returns:


getP1

public Point2D getP1()

Return the first point.

Returns:


getP2

public Point2D getP2()

Return the second point.

Returns:


getX1

public double getX1()

Return the x coordinate of the first point.

Returns:


getX2

public double getX2()

Return the x coordinate of the second point.

Returns:


getY1

public double getY1()

Return the y coordinate of the first point.

Returns:


getY2

public double getY2()

Return the y coordinate of the second point.

Returns:


setLine

public void setLine(double x1, double y1, double x2, double y2)

Set this line to the given points.

Parameters:


setLine

public void setLine(float x1, float y1, float x2, float y2)

Set this line to the given points.

Parameters: