public static class Line2D.Double extends Line2D implements Serializable
Line2D.Double, Line2D.Float| Modifier and Type | Field and Description |
|---|---|
double |
x1
线段的起始点的x坐标。
|
double |
x2
线段的端点的X坐标。
|
double |
y1
线段的起始点的Y坐标。
|
double |
y2
线段的端点的Y坐标。
|
| Constructor and Description |
|---|
Double()
构建与坐标初始化一个线(0,0)→(0,0)。
|
Double(double x1, double y1, double x2, double y2)
构造和初始化一个
Line2D从指定的坐标。
|
Double(Point2D p1, Point2D p2)
构造和初始化一个
Line2D从指定的
Point2D对象。
|
| Modifier and Type | Method and Description |
|---|---|
Rectangle2D |
getBounds2D()
返回一个高的精度和更精确的包围盒的
Shape比
getBounds方法。
|
Point2D |
getP1()
返回该
Line2D开始
Point2D。
|
Point2D |
getP2()
返回该
Line2D结束
Point2D。
|
double |
getX1()
返回双精度的起始点的x坐标。
|
double |
getX2()
返回双精度的终点的X坐标。
|
double |
getY1()
以双精度返回起始点的Y坐标。
|
double |
getY2()
以双精度返回终点的Y坐标。
|
void |
setLine(double x1, double y1, double x2, double y2)
设置指定的双坐标本
Line2D结束点的位置。
|
clone, contains, contains, contains, contains, getBounds, getPathIterator, getPathIterator, intersects, intersects, intersectsLine, intersectsLine, linesIntersect, ptLineDist, ptLineDist, ptLineDist, ptLineDistSq, ptLineDistSq, ptLineDistSq, ptSegDist, ptSegDist, ptSegDist, ptSegDistSq, ptSegDistSq, ptSegDistSq, relativeCCW, relativeCCW, relativeCCW, setLine, setLinepublic double x1
public double y1
public double x2
public double y2
public Double()
public Double(double x1,
double y1,
double x2,
double y2)
Line2D从指定的坐标。
x1 -起始点的x坐标
y1 -出发点的Y坐标
x2 -结束点的X坐标
y2 -结束点的Y坐标
public double getX1()
public double getY1()
public Point2D getP1()
Line2D开始
Point2D。
public double getX2()
public double getY2()
public Point2D getP2()
Line2D结束
Point2D。
public void setLine(double x1,
double y1,
double x2,
double y2)
Line2D结束点的位置。
public Rectangle2D getBounds2D()
Shape比
getBounds方法。需要注意的是不能保证返回的
Rectangle2D是最小包围盒包围
Shape,只有
Shape完全在于在显示
Rectangle2D。包围盒返回此方法通常是更严格的比
getBounds返回的方法,永远不会失败由于溢出的问题由于返回值可以是使用双精度值存储维度的
Rectangle2D实例。
请注意, definition of insideness可导致的情况下,点上的shape定义轮廓可能不被视为包含在返回的bounds对象,但只有在这些点的情况下,也不被认为是包含在原始的shape。
如果一个point在shape根据contains(point)方法,那么它必须在返回的Rectangle2D界根据的bounds的contains(point)方法对象。明确地:
shape.contains(p)需要bounds.contains(p)
如果一个point是不是在shape,那么它可能仍然包含在bounds对象:
bounds.contains(p)并不意味着shape.contains(p)
getBounds2D 接口
Shape
Rectangle2D包围盒的
Shape实例。
Shape.getBounds()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.