Shape インターフェース
- [内容]
- 幾何学的な形を表すオブジェクトの定義を提供します.このインターフェースを使用して,例えば,以下に示すような形を定義できます.
- Arc2D.Double(double x, double y, double w, double h, double start, double extent, int type)
- Arc2D.Float(float x, float y, float w, float h, float start, float extent, int type)
- 新しい弧を構築し、指定された位置、サイズ、角の大きさ、および閉じ方の種類に初期化
- CubicCurve2D.Double(double x1, double y1, double ctrlx1, double ctrly1, double ctrlx2, double ctrly2, double x2, double y2)
- CubicCurve2D.Float(float x1, float y1, float ctrlx1, float ctrly1, float ctrlx2, float ctrly2, float x2, float y2)
- 指定された座標から CubicCurve2D を構築および初期化
- Ellipse2D.Double(double x, double y, double w, double h)
- Ellipse2D.Float(float x, float y, float w, float h)
- 指定された座標から Ellipse2D を構築および初期化
- Line2D.Double(double x1, double y1, double x2, double y2)
- Line2D.Float(float x1, float y1, float x2, float y2)
- 指定された座標から Line を構築および初期化
- Polygon(int[] xpoints, int[] ypoints, int npoints)
- 指定されたパラメータから Polygon を構築および初期化
- Rectangle(int x, int y, int width, int height)
- 左上隅が (x,y) として指定され、幅と高さが width 引数および height 引数で指定される新しい Rectangle を構築
- Rectangle2D.Double ( double x, double y, double w, double h)
- Rectangle2D.Float ( float x, float y, float w, float h)
- 指定された座標から Rectangle2D を構築および初期化
- RoundRectangle2D.Double ( double x, double y, double w, double h, double arcw, double arch)
- RoundRectangle2D.Float ( float x, float y, float w, float h, float arcw, float arch)
- 指定された座標から RoundRectangle2D を構築および初期化
- [主なメソッド]
- boolean contains(double x, double y)
- 指定された座標が Shape の境界内にあるかどうかを判定
- boolean contains(Point2D p)
- 指定された Point2D が Shape の境界内にあるかどうかを判定
- boolean contains(double x, double y, double w, double h)
- Shape の内部領域が,指定された矩形領域を完全に包含するかどうかを判定
- boolean contains(Rectangle2D r)
- Shape の内部が,指定された Rectangle2D を完全に内包するかどうかを判定
- Rectangle getBounds()
- Shape を完全に囲む整数型の Rectangle を返す
- Rectangle2D getBounds2D()
- 高精度で getBounds メソッドより精密な Shape のバウンディングボックスを返す
- boolean intersects(double x, double y, double w, double h)
- Shape の内部領域が指定された矩形領域の内部領域と交差するかどうかを判定
- boolean intersects(Rectangle2D r)
- Shape の内部が指定された Rectangle2D の内部と交差するかどうかを判定
- [使用例]
- 「プログラム」は,Graphics2D クラスのメソッド setStroke,draw,setPaint,fill,transform,translate,rotate,scale,drawSring 等の使用例です.

- 「プログラム」は,Graphics2D クラスのメソッド drawImage 等の使用例です.
- 「プログラム」は,Graphics2D クラスのメソッド hit 等の使用例です.
- [参照]
- RescaleOp, LookupOp, ColorConvertOp, ConvolveOp, AffineTransform, AffineTransformOp, BufferedImage, PixelGrabber, MemoryImageSource, Graphics2D, Graphics