public final class ShapeGraphicAttribute extends GraphicAttribute
ShapeGraphicAttribute
クラスは、TextLayout
に形状をレンダリングするGraphicAttribute
の実装です。GraphicAttribute
修飾子と型 | フィールド | 説明 |
---|---|---|
static boolean |
FILL |
塗りつぶす必要がある形状を示すキーです。
|
static boolean |
STROKE |
1ピクセル幅のストロークでレンダリングする必要がある形状を示すキーです。
|
BOTTOM_ALIGNMENT, CENTER_BASELINE, HANGING_BASELINE, ROMAN_BASELINE, TOP_ALIGNMENT
コンストラクタ | 説明 |
---|---|
ShapeGraphicAttribute(Shape shape, int alignment, boolean stroke) |
指定された
Shape のShapeGraphicAttribute を構築します。 |
修飾子と型 | メソッド | 説明 |
---|---|---|
void |
draw(Graphics2D graphics, float x, float y) |
この
GraphicAttribute を指定された位置にレンダリングします。 |
boolean |
equals(Object rhs) |
この
ShapeGraphicAttribute を指定されたObject と比較します。 |
boolean |
equals(ShapeGraphicAttribute rhs) |
この
ShapeGraphicAttribute を指定されたShapeGraphicAttribute と比較します。 |
float |
getAdvance() |
この
ShapeGraphicAttribute の有効幅を返します。 |
float |
getAscent() |
この
ShapeGraphicAttribute のアセントを返します。 |
Rectangle2D |
getBounds() |
この
ShapeGraphicAttribute によってレンダリングされる全ビットを囲む、Rectangle2D を返します。これは、レンダリング位置を基準にして示されます。 |
float |
getDescent() |
この
ShapeGraphicAttribute のディセントを返します。 |
Shape |
getOutline(AffineTransform tx) |
この
ShapeGraphicAttribute によってレンダリングされる領域を表すShape を返します。 |
int |
hashCode() |
この
ShapeGraphicAttribute のハッシュ・コードを返します。 |
getAlignment, getJustificationInfo
public static final boolean STROKE
public static final boolean FILL
public ShapeGraphicAttribute(Shape shape, int alignment, boolean stroke)
Shape
のShapeGraphicAttribute
を構築します。shape
- レンダリングするShape
。 Shape
は、ホストTextLayout
のこのShapeGraphicAttribute
の原点を原点にしてレンダリングされる。 このオブジェクトはshape
への参照を保持する。 alignment
- このShapeGraphicAttribute
の配置方法の1つ。stroke
- Shape
をストロークでレンダリングする必要がある場合はtrue
、Shape
を塗りつぶす必要がある場合はfalse
。public float getAscent()
ShapeGraphicAttribute
のアセントを返します。 ShapeGraphicAttribute
のアセントはそのShape
の原点から、そのShape
の境界の最上部までの正の距離です。 getAscent
、クラスGraphicAttribute
ShapeGraphicAttribute
のアセント。GraphicAttribute.getBounds()
public float getDescent()
ShapeGraphicAttribute
のディセントを返します。 ShapeGraphicAttribute
のディセントとは、そのShape
の原点から、そのShape
の境界の最下部までの距離です。 getDescent
、クラスGraphicAttribute
ShapeGraphicAttribute
のディセント。GraphicAttribute.getBounds()
public float getAdvance()
ShapeGraphicAttribute
の有効幅を返します。 ShapeGraphicAttribute
の有効幅とは、そのShape
の原点から、そのShape
の境界の右端までの距離です。 getAdvance
、クラスGraphicAttribute
ShapeGraphicAttribute
の有効幅。GraphicAttribute.getBounds()
public void draw(Graphics2D graphics, float x, float y)
GraphicAttribute
を指定された位置にレンダリングします。draw
、クラスGraphicAttribute
graphics
- グラフィックのレンダリング先のGraphics2D
x
- グラフィックがレンダリングされるユーザー空間X座標y
- グラフィックがレンダリングされるユーザー空間Y座標public Rectangle2D getBounds()
ShapeGraphicAttribute
によってレンダリングされる全ビットを囲む、Rectangle2D
を返します。これは、レンダリング位置を基準にして示されます。 グラフィックは、原点、アセント、ディセント、有効幅を超えてレンダリングできますが、その場合はグラフィックをレンダリングする位置をこのメソッドの実装で示す必要があります。 getBounds
、クラスGraphicAttribute
ShapeGraphicAttribute
によってレンダリングされる全ビットを囲むRectangle2D
。public Shape getOutline(AffineTransform tx)
ShapeGraphicAttribute
によってレンダリングされる領域を表すShape
を返します。 これはTextLayout
がテキストの輪郭を返すように要求されたときに使用されます。 (変換されていない)形状は、getBounds
によって返される矩形境界の内側に収まっている必要があります。 getOutline
、クラスGraphicAttribute
tx
- このShapeGraphicAttribute
に適用するオプションのAffineTransform
。 nullを指定できる。 Shape
。public int hashCode()
ShapeGraphicAttribute
のハッシュ・コードを返します。hashCode
、クラスObject
ShapeGraphicAttribute
のハッシュ・コード値。Object.equals(java.lang.Object)
, System.identityHashCode(java.lang.Object)
public boolean equals(Object rhs)
ShapeGraphicAttribute
を指定されたObject
と比較します。equals
、クラスObject
rhs
- 等しいかどうかを比較するObject
ShapeGraphicAttribute
がrhs
の場合はtrue
、それ以外の場合はfalse
。Object.hashCode()
、HashMap
public boolean equals(ShapeGraphicAttribute rhs)
ShapeGraphicAttribute
を指定されたShapeGraphicAttribute
と比較します。rhs
- 等しいかどうかを比較するShapeGraphicAttribute
ShapeGraphicAttribute
がrhs
の場合はtrue
、それ以外の場合はfalse
。 バグまたは機能を送信
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。 そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Documentation Redistribution Policyも参照してください。