クラスShapeGraphicAttribute
java.lang.Object
java.awt.font.GraphicAttribute
java.awt.font.ShapeGraphicAttribute
public final class ShapeGraphicAttribute extends GraphicAttribute
ShapeGraphicAttributeクラスは、TextLayoutに形状をレンダリングするGraphicAttributeの実装です。- 関連項目:
-
フィールドのサマリー
フィールド修飾子と型フィールド説明static final boolean塗りつぶす必要がある形状を示すキーです。static final boolean1ピクセル幅のストロークでレンダリングする必要がある形状を示すキーです。クラスjava.awt.font.GraphicAttributeで宣言されたフィールド
BOTTOM_ALIGNMENT, CENTER_BASELINE, HANGING_BASELINE, ROMAN_BASELINE, TOP_ALIGNMENT -
コンストラクタのサマリー
コンストラクタコンストラクタ説明ShapeGraphicAttribute(Shape shape, int alignment, boolean stroke) 指定されたShapeのShapeGraphicAttributeを構築します。 -
メソッドのサマリー
修飾子と型メソッド説明voiddraw(Graphics2D graphics, float x, float y) このGraphicAttributeを指定された位置にレンダリングします。booleanこのShapeGraphicAttributeを指定されたShapeGraphicAttributeと比較します。booleanこのShapeGraphicAttributeを指定されたObjectと比較します。floatこのShapeGraphicAttributeの有効幅を返します。floatこのShapeGraphicAttributeのアセントを返します。このShapeGraphicAttributeによってレンダリングされる全ビットを囲む、Rectangle2Dを返します。これは、レンダリング位置を基準にして示されます。floatこのShapeGraphicAttributeのディセントを返します。このShapeGraphicAttributeによってレンダリングされる領域を表すShapeを返します。inthashCode()このShapeGraphicAttributeのハッシュ・コードを返します。クラスjava.awt.font.GraphicAttributeで宣言されたメソッド
getAlignment, getJustificationInfo
-
フィールド詳細
-
STROKE
public static final boolean STROKE1ピクセル幅のストロークでレンダリングする必要がある形状を示すキーです。- 関連項目:
-
FILL
public static final boolean FILL塗りつぶす必要がある形状を示すキーです。- 関連項目:
-
-
コンストラクタの詳細
-
ShapeGraphicAttribute
public ShapeGraphicAttribute(Shape shape, int alignment, boolean stroke) 指定されたShapeのShapeGraphicAttributeを構築します。- パラメータ:
shape- レンダリングするShape。Shapeは、ホストTextLayoutのこのShapeGraphicAttributeの原点を原点にしてレンダリングされる。 このオブジェクトはshapeへの参照を保持する。alignment- このShapeGraphicAttributeの配置方法の1つ。stroke-Shapeをストロークでレンダリングする必要がある場合はtrue、Shapeを塗りつぶす必要がある場合はfalse。
-
-
メソッドの詳細
-
getAscent
public float getAscent()このShapeGraphicAttributeのアセントを返します。ShapeGraphicAttributeのアセントはそのShapeの原点から、そのShapeの境界の最上部までの正の距離です。- 定義:
getAscent、クラスGraphicAttribute- 戻り値:
- この
ShapeGraphicAttributeのアセント。 - 関連項目:
-
getDescent
public float getDescent()このShapeGraphicAttributeのディセントを返します。ShapeGraphicAttributeのディセントとは、そのShapeの原点から、そのShapeの境界の最下部までの距離です。- 定義:
getDescent、クラスGraphicAttribute- 戻り値:
- この
ShapeGraphicAttributeのディセント。 - 関連項目:
-
getAdvance
public float getAdvance()このShapeGraphicAttributeの有効幅を返します。ShapeGraphicAttributeの有効幅とは、そのShapeの原点から、そのShapeの境界の右端までの距離です。- 定義:
getAdvance、クラスGraphicAttribute- 戻り値:
- この
ShapeGraphicAttributeの有効幅。 - 関連項目:
-
draw
public void draw(Graphics2D graphics, float x, float y) このGraphicAttributeを指定された位置にレンダリングします。- 定義:
draw、クラスGraphicAttribute- パラメータ:
graphics- グラフィックのレンダリング先のGraphics2Dx- グラフィックがレンダリングされるユーザー空間X座標y- グラフィックがレンダリングされるユーザー空間Y座標
-
getBounds
public Rectangle2D getBounds()このShapeGraphicAttributeによってレンダリングされる全ビットを囲む、Rectangle2Dを返します。これは、レンダリング位置を基準にして示されます。 グラフィックは、原点、アセント、ディセント、有効幅を超えてレンダリングできますが、その場合はグラフィックをレンダリングする位置をこのメソッドの実装で示す必要があります。- オーバーライド:
getBounds、クラスGraphicAttribute- 戻り値:
- この
ShapeGraphicAttributeによってレンダリングされる全ビットを囲むRectangle2D。
-
getOutline
public Shape getOutline(AffineTransform tx) このShapeGraphicAttributeによってレンダリングされる領域を表すShapeを返します。 これはTextLayoutがテキストの輪郭を返すように要求されたときに使用されます。 (変換されていない)形状は、getBoundsによって返される矩形境界の内側に収まっている必要があります。- オーバーライド:
getOutline、クラスGraphicAttribute- パラメータ:
tx- このShapeGraphicAttributeに適用するオプションのAffineTransform。 nullを指定できる。- 戻り値:
- ストローク・レンダリングや塗りつぶしに適した、このGraphicAttributeを表す
Shape。 - 導入されたバージョン:
- 1.6
-
hashCode
-
equals
-
equals
public boolean equals(ShapeGraphicAttribute rhs) このShapeGraphicAttributeを指定されたShapeGraphicAttributeと比較します。- パラメータ:
rhs- 等しいかどうかを比較するShapeGraphicAttribute- 戻り値:
- この
ShapeGraphicAttributeがrhsの場合はtrue、それ以外の場合はfalse。
-