public static class Ellipse2D.Float extends Ellipse2D implements Serializable
Float
クラスは、float
精度で指定された楕円を定義します。Ellipse2D.Double, Ellipse2D.Float
修飾子と型 | フィールド | 説明 |
---|---|---|
float |
height |
この
Ellipse2D の全体の高さ。 |
float |
width |
この
Ellipse2D の全体の幅。 |
float |
x |
この
Ellipse2D の表示枠矩形の左上隅のX座標。 |
float |
y |
この
Ellipse2D の表示枠矩形の左上隅のY座標。 |
コンストラクタ | 説明 |
---|---|
Float() |
新しい
Ellipse2D を構築し、位置(0, 0)およびサイズ(0, 0)に初期化します。 |
Float(float x, float y, float w, float h) |
指定された座標から
Ellipse2D を構築および初期化します。 |
修飾子と型 | メソッド | 説明 |
---|---|---|
Rectangle2D |
getBounds2D() |
高精度で、かつ
getBounds メソッドより正確なShape のバウンディング・ボックスを返します。 |
double |
getHeight() |
表示枠矩形の高さを
double 精度で返します。 |
double |
getWidth() |
表示枠矩形の幅を
double 精度で返します。 |
double |
getX() |
表示枠矩形の左上隅のX座標を
double 精度で返します。 |
double |
getY() |
表示枠矩形の左上隅のY座標を
double 精度で返します。 |
boolean |
isEmpty() |
RectangularShape が空であるかどうかを判定します。 |
void |
setFrame(double x, double y, double w, double h) |
この
Shape の表示枠矩形の位置とサイズを、指定された矩形値に設定します。 |
void |
setFrame(float x, float y, float w, float h) |
この
Shape の表示枠矩形の位置とサイズを、指定された矩形値に設定します。 |
contains, contains, equals, getPathIterator, hashCode, intersects
clone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, getPathIterator, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
public float x
Ellipse2D
の表示枠矩形の左上隅のX座標。public float y
Ellipse2D
の表示枠矩形の左上隅のY座標。public float width
Ellipse2D
の全体の幅。public float height
Ellipse2D
の全体の高さ。public Float()
Ellipse2D
を構築し、位置(0, 0)およびサイズ(0, 0)に初期化します。public Float(float x, float y, float w, float h)
Ellipse2D
を構築および初期化します。x
- 表示枠矩形の左上隅のX座標y
- 表示枠矩形の左上隅のY座標w
- 表示枠矩形の幅h
- 表示枠矩形の高さpublic double getX()
double
精度で返します。getX
、クラスRectangularShape
public double getY()
double
精度で返します。getY
、クラスRectangularShape
public double getWidth()
double
精度で返します。getWidth
、クラスRectangularShape
public double getHeight()
double
精度で返します。getHeight
、クラスRectangularShape
public boolean isEmpty()
RectangularShape
が空であるかどうかを判定します。 RectangularShape
が空の場合は、領域はありません。 isEmpty
、クラスRectangularShape
RectangularShape
が空である場合はtrue
、そうでない場合はfalse
。public void setFrame(float x, float y, float w, float h)
Shape
の表示枠矩形の位置とサイズを、指定された矩形値に設定します。x
- 指定された矩形形状の左上隅のX座標y
- 指定された矩形形状の左上隅のY座標w
- 指定された矩形形状の幅h
- 指定された矩形形状の高さpublic void setFrame(double x, double y, double w, double h)
Shape
の表示枠矩形の位置とサイズを、指定された矩形値に設定します。setFrame
、クラスRectangularShape
x
- 指定された矩形形状の左上隅のX座標y
- 指定された矩形形状の左上隅のY座標w
- 指定された矩形形状の幅h
- 指定された矩形形状の高さRectangularShape.getFrame()
public Rectangle2D getBounds2D()
getBounds
メソッドより正確なShape
のバウンディング・ボックスを返します。 返されたRectangle2D
が、Shape
を囲む最小のバウンディング・ボックスであるという保証はありません。Shape
が、示されたRectangle2D
内に完全に含まれているだけです。 戻り値を、倍精度値を使用して寸法を格納するRectangle2D
のインスタンスにすることができるため、このメソッドによって返されたバウンディング・ボックスは通常、getBounds
メソッドによって返されたものより厳密であり、オーバーフローの問題のために失敗することはありません。
内側の定義によって、shape
の定義する輪郭上の点が、返されたbounds
オブジェクトに含まれていると見なされない状況が発生する場合があります。ただし、これは、これらの点が元のshape
にも含まれていないと見なされる場合のみです。
point
がcontains(point)
メソッドに従ってshape
の内側にある場合は、bounds
のcontains(point)
メソッドに従って、返されたRectangle2D
境界オブジェクトの内側にある必要があります。 具体的には、次のようになります。
shape.contains(p)
にはbounds.contains(p)
が必要
point
がshape
の内側にない場合は、引き続きbounds
オブジェクトに含まれている可能性があります。
bounds.contains(p)
はshape.contains(p)
を示さない
getBounds2D
、インタフェースShape
Shape
の高精度のバウンディング・ボックスであるRectangle2D
のインスタンス。Shape.getBounds()
バグまたは機能を送信
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。 そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Documentation Redistribution Policyも参照してください。